Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why TravisCI builds fails during npm install due to file lock

Tags:

npm

travis-ci

npm install fails due to a file lock issue. How can I avoid this?

Here is the log of travis-ci:

npm ERR! EEXIST, open '/home/travis/.npm/83f1dfb7-vis-npm-lodash-2-4-1-package-tgz.lock'
File exists: /home/travis/.npm/83f1dfb7-vis-npm-lodash-2-4-1-package-tgz.lock
Move it away, and try again. 
npm ERR! System Linux 2.6.32-042stab090.5
npm ERR! command "/home/travis/.nvm/v0.10.32/bin/node" "/home/travis/.nvm/v0.10.32/bin/npm" "install"
npm ERR! cwd /home/travis/build/wordnik/swagger-editor
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! path /home/travis/.npm/83f1dfb7-vis-npm-lodash-2-4-1-package-tgz.lock
npm ERR! code EEXIST
npm ERR! errno 47
npm ERR! not ok code 0
The command "npm install" failed and exited with 47 during .
like image 577
Mohsen Avatar asked Oct 20 '14 20:10

Mohsen


People also ask

Why is npm install failing?

The error in NPM, 'error package install failed, see above', can occur when the user creates a new project in Angular using Node. js using VS code. This means that NPM is corrupted in your system, and must reinstall NPM.

How do I force an npm package to install?

Run npm update -g npm. Execute this command by running the command prompt as Administrator npm install -g windows-build-tools. Run npm install inside the project folder where the package. json file is located, if it doesn't work run: npm install --force.


1 Answers

Updating to npm to version 2 fixed my issue.

install:
  - npm install -g npm@2
like image 144
Mohsen Avatar answered Sep 20 '22 02:09

Mohsen