5

I'm using npm 3.3.6 and when I try to install a bunch of modules I get the error below:

npm i babel-cli babel-plugin-syntax-async-functions babel-plugin-transform-regenerator babel-polyfill babel-preset-es2015 babelify watchify browserify --save-dev

npm ERR! Darwin 15.0.0
npm ERR! argv "/Users/thomas/.nvm/versions/node/v5.0.0/bin/node" "/Users/thomas/.nvm/versions/node/v5.0.0/bin/npm" "i" "babel-cli" "babel-plugin-syntax-async-functions" "babel-plugin-transform-regenerator" "babel-polyfill" "babel-preset-es2015" "babelify" "watchify" "browserify" "--save-dev"
npm ERR! node v5.0.0
npm ERR! npm  v3.3.6
npm ERR! path /Users/thomas/Desktop/esnext-bootstrap/node_modules/babel-cli/node_modules/chokidar/node_modules/fsevents/node_modules/asn1
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename

npm ERR! enoent ENOENT: no such file or directory, rename '/Users/thomas/Desktop/esnext-bootstrap/node_modules/babel-cli/node_modules/chokidar/node_modules/fsevents/node_modules/asn1' -> '/Users/thomas/Desktop/esnext-bootstrap/node_modules/asn1'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/thomas/Desktop/esnext-bootstrap/npm-debug.log

I have no clue whats going on here or what module specifically is causing the issue. I can see it involves babel-cli, chokidar, and ans1, but when I install babel-cli alone it works without an error.

Just installed every module individually and it worked fine.

1
  • I just ran a complete test installing each module separately and together and no errors occurred. I removed the node_modules folder both times. If anyone is looking to recreate here's a starter repo. Commented Nov 10, 2015 at 22:37

3 Answers 3

2

I am seeing a similar issue. The issue is caused when the node_modules directory exists and you run npm install. There is some name collision. If you remove the node_modules directory you won't have the issue.

1
  • and if you are installing globally, you'll need to remove the node_modules folder on the global copy. Thanks @martin for this answer.
    – rugg
    Commented May 25, 2018 at 16:42
2

I had a very similar issue and it was because I was trying to do an npm install from a mounted HGFS volume in Ubunutu.

This is because I use VMWare Fusion on OSX to virtualise Ubuntu, then mount shared OSX directories in Ubuntu.

Another npm install with the same source in a non-mounted directory (ie, my Ubuntu home folder) worked as expected.

1
  • Ah, good point, running on a filesystem that doesn't allow symlinks is going to break the build (so also windows shares).
    – voneiden
    Commented May 18, 2020 at 13:22
0

When I have had this error I kill/close all running instances of node in my task manager (process explorer on windows). It's often vscode or webstorm that has an open node process running. For me after closing these programs and ensuring there is no running node processes npm install will now work again.

Not the answer you're looking for? Browse other questions tagged or ask your own question.