在我的laravel项目上安装npm的问题 [英] Problem on npm installing on my laravel project
问题描述
我正在尝试在laravel上安装"npm",但始终会遇到此错误.
Im trying to the "npm install on laravel but always encounter this error.
推荐答案
我已经受此问题困扰很长时间了,看来问题出在内部,把 npm install 用作无业游民的用户 laravel/homestead box ,所以主要问题是对同步文件夹的权限之一,这是Homestead.yaml的主要任务.
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.
引用于: 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.
在Homestead.yaml上的文件夹映射下方插入下一行
Insert the next line just below your folder mapping on Homestead.yaml
type: "nfs"
此处的文档: https://laravel.com/docs/8.x/宅基
下一个选项仅在您的系统上起作用,该选项具有所有权限,因为它拥有您正在使用的文件夹.
Next option is just working from your system, that has all permissions since it owns the folder in wich you are working.
与其在流浪汉中执行npm install,而是转到系统(您的计算机)中的文件夹,然后从那里使用命令.
如果您需要全新安装项目,请使用:
If you need to clean install your project use:
rm -rf node_modules
npm cache clean
这篇关于在我的laravel项目上安装npm的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!