question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

npm install got error on vagrant

See original GitHub issue

NPM version: 3.10.2 NODE version: v4.4.0 I got this error when run npm install:

npm ERR! Linux 3.13.0-85-generic
npm ERR! argv "/home/vagrant/.nvm/versions/node/v4.4.0/bin/node" "/home/vagrant/.nvm/versions/node/v4.4.0/bin/npm" "install"
npm ERR! node v4.4.0
npm ERR! npm  v3.10.2
npm ERR! path /vagrant/mern-starter/node_modules/nyc/node_modules/foreground-child/node_modules/which/bin/which
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod

npm ERR! enoent ENOENT: no such file or directory, chmod '/vagrant/mern-starter/node_modules/nyc/node_modules/foreground-child/node_modules/which/bin/which'
npm ERR! enoent ENOENT: no such file or directory, chmod '/vagrant/mern-starter/node_modules/nyc/node_modules/foreground-child/node_modules/which/bin/which'
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!     /vagrant/mern-starter/npm-debug.log

then I try to run npm start And get this

/vagrant/mern-starter/node_modules/babel-core/lib/transformation/file/index.js:591
      throw err;
      ^

Error: /vagrant/mern-starter/server/server.js: Cannot find module '../features'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/vagrant/mern-starter/node_modules/caniuse-api/dist/index.js:19:32)
    at Module._compile (module.js:409:26)
    at Module._extensions..js (module.js:416:10)
    at Object.require.extensions.(anonymous function) [as .js] (/vagrant/mern-starter/node_modules/babel-register/lib/node.js:166:7)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
[nodemon] app crashed - waiting for file changes before starting...

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
amoshydracommented, Aug 7, 2016

Just tried @liamegan 's suggestion in https://github.com/Hashnode/mern-cli/issues/16. npm install now run successfully in my vagrant.

$ mkdir ~/node_modules/
$ cd ~/your_new_app/
$ ln -s ~/node_modules/

Need to change permision for the node_modules too sudo chown -R $USER:$GROUP ~/node_modules

then do npm install

0reactions
amrnegmcommented, Mar 20, 2019

I had a similar problem but the error was related to syscall open rather than syscall chmod. There is some problem with shared folder as stated above. I followed @amoshydra’s steps above, without running chmod, and modules installed. Thanks @amoshydra!

Still the root cause of this issue is not known! Hope someone can find it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

npm doesn't work in vagrant · Issue #7308 - GitHub
Hey guys, hit this issue yesterday and found out that you can get around it by creating a symlink of your ./node_modules directory...
Read more >
npm install modules throwing an ENOENT error within local ...
I have tried: - Destroying my vagrant box and reinstalling it - reinstalling npm, node and nvm (a few times - which apparently...
Read more >
How to fix 'npm install' errors on vagrant on windows because ...
The gist of this story is that npm install in a vagrant virtual environment sometimes makes some REALLY long paths and it makes...
Read more >
Homestead - npm install error - Laracasts
First, do "vagrant halt", then go to the project file, right click and open the terminal, then "npm install" will install it.
Read more >
Install nodejs and run yarn install as part of Vagrant provision
As I thought may happen, the out of the box settings give symlink related errors when running Vagrant on a Windows host, since...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found