Homestead npm install 找不到package.json 文件 [英] Homestead npm install can't find package.json file
问题描述
过去 2 天我一直在尝试运行 npm install 以便我可以使用 laravel mix.在搜索了无数论坛、repos 和线程后,我还没有找到解决我的问题的方法,那就是当我 cd 到我的 Laravel 新创建的项目并运行 sudo npm install
时,我收到以下错误>
I've been trying for the past 2 days to run npm install so I can use laravel mix. After searching innumerous forums, repos and threads, I have not yet found a solution for my problem, which is when I cd into my laravel new created project and run sudo npm install
I get the following error
npm ERR! path /home/vagrant/Code/matt-fm/node_modules/yargs/node_modules/wrap-ansi/node_modules/strip-ansi/package.json.2538224843
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/home/vagrant/Code/matt-fm/node_modules/yargs/node_modules/wrap-ansi/node_modules/strip-ansi/package.json.2538224843'
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/2019-07-12T12_52_05_433Z-debug.log
我已经删除了 node_modules 文件夹并再次尝试运行,没有成功.我尝试删除整个流浪盒并再次安装,但没有成功.清理 npm 缓存也不起作用.
I have already removed the node_modules folder and tried running again, no success. I tried removed the whole vagrant box and installing again, no success. Cleaning the npm cache doesn't work neither.
推荐答案
我在 homestead 遇到了同样的问题,经过大量时间浪费后,我找到了解决方案.只需使用 yarn install
I've had same problem with homestead and after a lot of time waste, I found a solution for it. Simply use yarn install
这篇关于Homestead npm install 找不到package.json 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!