用homestead出现的一些问题,问下大家有没有碰到过

我用homestead来安装laravel,安装的是最新的laravel8,就是照着文档,
composer create-project –prefer-dist laravel/laravel blog
这个倒是成功了。
但是当我 npm install,想把npm包下载下来时候,老是出现错误

npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN ws@7.4.5 requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN ws@7.4.5 requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself.

npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/vagrant/homecode/newblog/node_modules/@types/clean-css/node_modules/source-map/package.json.2732763670
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/home/vagrant/homecode/newblog/node_modules/@types/clean-css/node_modules/source-map/package.json.2732763670'
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/2021-04-20T12_14_46_984Z-debug.log

然后再运行 npm run dev 时候就报

npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! @ development: `mix`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the @ development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vagrant/.npm/_logs/2021-04-20T12_15_33_249Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vagrant/.npm/_logs/2021-04-20T12_15_33_426Z-debug.log

大家用homestead 有没有遇到过这种情况,还是我用的这个homestead 有什么问题?
是这个homestead里面配置有问题吗?

《L01 基础入门》
我们将带你从零开发一个项目并部署到线上,本课程教授 Web 开发中专业、实用的技能,如 Git 工作流、Laravel Mix 前端工作流等。
《L05 电商实战》
从零开发一个电商项目,功能包括电商后台、商品 & SKU 管理、购物车、订单管理、支付宝支付、微信支付、订单退款流程、优惠券等
讨论数量: 5
ShiKi
npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vagrant/.npm/_logs/2021-04-20T12_14_46_984Z-debug.log

看下这个日志文件呗

2年前 评论
donggan (楼主) 2年前
ShiKi (作者) 2年前
donggan (楼主) 2年前

file

2年前 评论
donggan (楼主) 2年前

能看出来问题吧。这应该是版本的问题吧。你按提示。自己修改一下依赖。

2年前 评论
donggan (楼主) 2年前
Fell-boy (作者) 2年前

warning 只是警告,并不是造成停止的原因,真正的原因在:

npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/home/vagrant/homecode/newblog/node_modules/@types/clean-css/node_modules/source-map/package.json.2732763670' 

大意是文件没找到,如果你是刚开箱的话,尝试 npm cache clean --force,然后再执行 npm install,如果没解决,尝试百度搜索这几个关键词 npm ERR! code ENOENTnpm ERR! syscall opennpm ERR! enoent ENOENT: no such file or directory 应该是个小问题,细心查一下就解决了 enjoy~ :smile:

2年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!