Im trying to the "npm install on laravel but always encounter this error.
-
github.com/Microsoft/nodejs-guidelines/blob/master/… looks like a good readapokryfos– apokryfos2020-09-30 06:36:42 +00:00Commented Sep 30, 2020 at 6:36
-
I am voting to close this question as it Needs Debugging Details. Please do not upload images of code/data/errors.Nimantha– Nimantha2025-07-17 13:29:31 +00:00Commented Jul 17 at 13:29
3 Answers
I've suffered with this issue for a long time and it seems that the problem is using npm install as a vagrant user inside a laravel/homestead box so the main issue is one of permissions on a synced folder which is the main task of Homestead.yaml.
Referenced in: https://www.vagrantup.com/docs/synced-folders/nfs.html
There's two solutions for this problem:
One will enable you to work from homestead normally, and the other is just like a patch of sorts.
Insert the next line just below your folder mapping on Homestead.yaml
type: "nfs"
Documentation of that here: https://laravel.com/docs/8.x/homestead
Next option is just working from your system, that has all permissions since it owns the folder in wich you are working.
Instead of executing npm install inside vagrant go to the folder in your system (your computer) and use the command from there.
If you need to clean install your project use:
rm -rf node_modules
npm cache clean
