-1

Im trying to the "npm install on laravel but always encounter this error.

enter image description here

2

3 Answers 3

2

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
Sign up to request clarification or add additional context in comments.

2 Comments

That error screen looks like its on windows (where nfs is ignored)
Good point, but even then Laravel Documentation recommends that if there is a need to use "nfs" on Windows you can do it, giving that you install this package: github.com/winnfsd/vagrant-winnfsd
0

Try cleaning your cache and executing a new install:

Execute this at the root of your laravel project:

rm -rf node_modules
npm cache clean
npm install

If it still fails, try rebuilding node sass:

npm rebuild node-sass

Comments

0

I ran into this issue while installing the dependencies, and it looks like you are using cmder as the CLI for this. This was my case too, so when I tried to install it from the vsCode terminal, I successfully installed it.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.