2.0.1vagrant-vmware-fusion (5.0.4)laravel/homestead (v5.0.1)MacOS High Sierra 10.13.1 (17B1003)
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: vmware_fusion
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/code/
to: /home/vagrant/code/
sites:
- map: hodgehill.test
to: /home/vagrant/code/hodgehill/public
databases:
- homestead
NPM Install falls over with this error.
npm ERR! path /home/vagrant/code/hodgehill/node_modules/.acorn-dynamic-import.DELETE/node_modules/acorn
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/home/vagrant/code/hodgehill/node_modules/.acorn-dynamic-import.DELETE/node_modules/acorn' -> '/home/vagrant/code/hodgehill/node_modules/acorn-dynamic-import/node_modules/acorn'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vagrant/.npm/_logs/2017-12-04T20_55_21_208Z-debug.log
Does the error happen when running NPM from your mac?
Can you post the contents of /home/vagrant/.npm/_logs/2017-12-04T20_55_21_208Z-debug.log and your package.json
I don't have NPM on my Mac.
Here is the exciting stuff at the end.
23939 silly remove /home/vagrant/code/hodgehill/node_modules/path-type
23940 silly remove /home/vagrant/code/hodgehill/node_modules/preserve
23941 silly remove /home/vagrant/code/hodgehill/node_modules/process
23942 silly remove /home/vagrant/code/hodgehill/node_modules/process-nextick-args
23943 silly remove /home/vagrant/code/hodgehill/node_modules/prr
23944 silly remove /home/vagrant/code/hodgehill/node_modules/errno
23945 silly remove /home/vagrant/code/hodgehill/node_modules/punycode
23946 silly remove /home/vagrant/code/hodgehill/node_modules/querystring
23947 silly remove /home/vagrant/code/hodgehill/node_modules/querystring-es3
23948 silly doSerial move 11228
23949 silly doSerial finalize 11228
23950 silly finalize /home/vagrant/code/hodgehill/node_modules/abbrev
23951 silly finalize /home/vagrant/code/hodgehill/node_modules/acorn
23952 silly finalize /home/vagrant/code/hodgehill/node_modules/acorn-dynamic-import/node_modules/acorn
23953 silly finalize /home/vagrant/code/hodgehill/node_modules/acorn-dynamic-import
23954 verbose unlock done using /home/vagrant/.npm/_locks/staging-76c5875edd92d088.lock for /home/vagrant/code/hodgehi$
23955 verbose stack Error: ENOENT: no such file or directory, rename '/home/vagrant/code/hodgehill/node_modules/.acorn$
23956 verbose cwd /home/vagrant/code/hodgehill
23957 verbose Linux 4.4.0-101-generic
23958 verbose argv "/usr/bin/node" "/usr/bin/npm" "install"
23959 verbose node v8.9.1
23960 verbose npm v5.5.1
23961 error path /home/vagrant/code/hodgehill/node_modules/.acorn-dynamic-import.DELETE/node_modules/acorn
23962 error code ENOENT
23963 error errno -2
23964 error syscall rename
23965 error enoent ENOENT: no such file or directory, rename '/home/vagrant/code/hodgehill/node_modules/.acorn-dynamic$
23966 error enoent This is related to npm not being able to find a file.
23967 verbose exit [ -2, true ]
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"axios": "^0.16.2",
"bootstrap-sass": "^3.3.7",
"cross-env": "^5.1.1",
"jquery": "^3.1.1",
"laravel-mix": "^1.0",
"lodash": "^4.17.4",
"vue": "^2.1.10"
},
"dependencies": {}
}
Not sure how much help I'm going to be. Google shows it could be symlinking issues (but you're not on windows) and some mounting issues (But your shared bits of logs don't mention it).
Try rm -rf node_modules && npm install. If the error persists you can check if it's possibly an NPM issue by trying rm -rf node_modules && yarn install.
Thanks for your help @svpernova09 it was as NPM issue yarn worked great.
Install node.js on your Windows host and execute npm install in the code directory
The underlying problem is related to how Windows file locking is handled by Virtualbox sharing. It happens whether using standard shared folders (vboxsf) or nfs. If a file is opened or read (locked) by another process while npm is trying to change it the whole install process fails.
How to fix:
vagrant up (and other commands) from an administrator terminal. This ensures symlinks work correctly. There are other ways to enable symlinks - if you use one of them be sure to test them out using ln -s a b within the shared folder.If you are still having issues with point 2 above, you can use Process Monitor, filtered to your vagrant directory, to detect access by any process other than Virtualbox (VBoxHeadless.exe).
With the above in place I am able to successfully run npm install without issue.
The underlying problem is related to how Windows file locking is handled by Virtualbox sharing. It happens whether using standard shared folders (vboxsf) or nfs. If a file is opened or read (locked) by another process while
npmis trying to change it the whole install process fails.How to fix:
- Run
vagrant up(and other commands) from an administrator terminal. This ensures symlinks work correctly. There are other ways to enable symlinks - if you use one of them be sure to test them out usingln -s a bwithin the shared folder.Ensure that no other process opens any of the files in the shared folder by either disabling the process or excluding the vagrant folder. This includes, but is not limited to:
- Windows Defender or other anti virus software
- Windows search index or other indexing software
- Dropbox or other file synchronisation software.
If you are still having issues with point 2 above, you can use Process Monitor, filtered to your vagrant directory, to detect access by any process other than Virtualbox (VBoxHeadless.exe).
With the above in place I am able to successfully run
npm installwithout issue.
It's pretty interesting that issues on a Mac running Sierra are related to Windows file-locking. Did you even read the issue before commenting?
Most helpful comment
Not sure how much help I'm going to be. Google shows it could be symlinking issues (but you're not on windows) and some mounting issues (But your shared bits of logs don't mention it).
Try
rm -rf node_modules && npm install. If the error persists you can check if it's possibly an NPM issue by tryingrm -rf node_modules && yarn install.