Windows10系統執行npm install報錯一大堆!

懶惰的大叔發表於2021-01-31

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' 

上面的錯誤用 npm install –no-bin-links’解決


vagrant@homestead:~/Code/Laravel$ rm -rf node_modules
vagrant@homestead:~/Code/Laravel$ npm install --no-bin-links
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 notice created a lockfile as package-lock.json. You should commit this file.
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"})

added 1158 packages from 518 contributors in 120.81s

92 packages are looking for funding
  run `npm fund` for details

這個錯誤經過搜尋解決方法:

npm 警告棄用的 popper.js@1.16.1: 您可以在 @popperjs/core 找到新的 Popper v2, 此包專用於舊 v1

執行命令以刪除已棄用的包並安裝其新的 Popper v2npm uninstall popper.js && npm i @popperjs/core

然後又報下面這個錯誤:
在網上搜尋了一下說原因是:
fsevents不在package.json裡,但是仍然安裝了,是因為你的系統是Windows系統,fsevents是蘋果系統的可選依賴,你的專案有可能是團隊專案,別人在他的mac上安裝了fsevents相關依賴庫,所以到這邊你也就安裝到你的windows上邊了。你可以檢查你的package.json 檔案中是不是有fsevents相關依賴,刪除即好!
如果沒有,其他的npm包也會有依賴fsevents的!!!
這是warning錯誤,是因為mac下需要 fsevents,這裡是在windows環境,所以可以忽略這個警告,對你沒什麼影響的。

(目前我還不知道解決方法,後續補發出來。如果有知道的朋友可以在評論區評論)

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"})

added 1158 packages from 517 contributors in 115.632s

92 packages are looking for funding
run npm fund for details

```

本作品採用《CC 協議》,轉載必須註明作者和本文連結
懶惰的大叔

相關文章