Note npm ci is now the default npm install mechanism instead of npm install
Since npm ci strictly adheres to the dependencies list on package-lock.json, it removes node_modules that may be installed using package.json before it begins its own installs. This way the cached modules and npm commands from the old cache location node_modules won't work. Therefore, travis will throw an error complaining "cannot find /node_modules/.bin/npm" after running npm ci.
There are two solutions to this problem:
Fully transition to npm ci, and keep the npm cache at new location to speed up installs
cache:
directories:
- "$HOME/.npm"
Specify to use old install, and continue to use the old cache location
According to doc and some benchmark tests, npm ci is introduced to ensure proper build with package-lock.json and have build time twice faster than npm install, boosting your Travis build speed.
See here docs.npmjs.com/cli/ci
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Note
npm ci
is now the default npm install mechanism instead ofnpm install
Since
npm ci
strictly adheres to the dependencies list onpackage-lock.json
, it removesnode_modules
that may be installed usingpackage.json
before it begins its own installs. This way the cached modules and npm commands from the old cache locationnode_modules
won't work. Therefore, travis will throw an error complaining "cannot find /node_modules/.bin/npm" after runningnpm ci
.There are two solutions to this problem:
npm ci
, and keep the npm cache at new location to speed up installsAccording to doc and some benchmark tests,
npm ci
is introduced to ensure proper build withpackage-lock.json
and have build time twice faster thannpm install
, boosting your Travis build speed.See here docs.npmjs.com/cli/ci