执行npm install报错一大堆!

vagrant@homestead:~/Code/Laravel$ npm install
npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
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 @types/browserslist@4.15.0: This is a stub types definition. browserslist provides its own type definitions, so you do not need this installed.
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 notsup Unsupported engine for laravel-mix@6.0.11: wanted: {"node":">=12.14.0"} (current: {"node":"12.10.0","npm":"6.14.11"})
npm WARN notsup Not compatible with your version of node/npm: laravel-mix@6.0.11
npm WARN sass-loader@8.0.2 requires a peer of node-sass@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN sass-loader@8.0.2 requires a peer of fibers@>= 3.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN ws@7.4.2 requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN ws@7.4.2 requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.1 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code EPROTO
npm ERR! syscall symlink
npm ERR! path ../@babel/parser/bin/babel-parser.js
npm ERR! dest /home/vagrant/Code/Laravel/node_modules/.bin/parser
npm ERR! errno -71
npm ERR! EPROTO: protocol error, symlink '../@babel/parser/bin/babel-parser.js' -> '/home/vagrant/Code/Laravel/node_modules/.bin/parser'

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vagrant/.npm/_logs/2021-01-30T20_16_50_249Z-debug.log
vagrant@homestead:~/Code/Laravel$

之前一直用mac电脑,刚买了新电脑Windows10系统,执行npm install的时候出现很多错误,不知道该怎么解决。也按照教程使用了yarn,也是同样的效果。

懒惰的大叔
《L03 构架 API 服务器》
你将学到如 RESTFul 设计风格、PostMan 的使用、OAuth 流程,JWT 概念及使用 和 API 开发相关的进阶知识。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
讨论数量: 4

将下面代码加入到 Homestead.yaml 文件的 folders 中,通过在 options 中列出 Vagrant 的 同步文件夹 支持的任何选项: type: "rsync" options: rsync__args: ["--verbose", "--archive", "--delete", "-zz"] rsync__exclude: ["node_modules"]

1年前 评论
  type: "rsync"
  options:
    rsync__args: ["--verbose", "--archive", "--delete", "-zz"]
    rsync__exclude: ["node_modules"]
1年前 评论

我亲自试了一下,用 rsync 有一个问题,他是单向同步的,只能从 windows 同步到虚拟机,而不能从虚拟机同步到 windows 的共享目录。比如虚拟机上执行 npm install 生成的代码文件,在 windows 上是看不到的。这样不太方便。 我又研究了一下,还是用 nfs 比较方便,需要先装一个 vagrant-winnfsd 扩展插件,命令如下: vagrant plugin install vagrant-winnfsd 然后在 Homestead.yaml 文件的 folders 中,设置 type: "nfs",重启虚拟机并重新载入配置 vagrant reload --provision 然后再安装就可以了

1年前 评论

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