用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里面配置有问题吗?

《L02 从零构建论坛系统》
以构建论坛项目 LaraBBS 为线索,展开对 Laravel 框架的全面学习。应用程序架构思路贴近 Laravel 框架的设计哲学。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
讨论数量: 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

看下这个日志文件呗

1个月前 评论
donggan (楼主) 1个月前
ShiKi (作者) 1个月前
donggan (楼主) 1个月前

file

1个月前 评论
donggan (楼主) 1个月前

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

1个月前 评论
donggan (楼主) 1个月前
huanbird (作者) 1个月前

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:

1个月前 评论

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