请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

sudo npm install webpack -g出错

在终端输入sudo npm install webpack -g出错,提示如下:
npm WARN engine webpack@5.75.0: wanted: {“node”:">=10.13.0"} (current: {“node”:“4.4.7”,“npm”:“2.15.8”})
npm WARN engine chrome-trace-event@1.0.3: wanted: {“node”:">=6.0"} (current: {“node”:“4.4.7”,“npm”:“2.15.8”})
npm WARN engine loader-runner@4.3.0: wanted: {“node”:">=6.11.5"} (current: {“node”:“4.4.7”,“npm”:“2.15.8”})
npm WARN engine schema-utils@3.1.1: wanted: {“node”:">= 10.13.0"} (current: {“node”:“4.4.7”,“npm”:“2.15.8”})
npm WARN engine webpack-sources@3.2.3: wanted: {“node”:">=10.13.0"} (current: {“node”:“4.4.7”,“npm”:“2.15.8”})
npm WARN engine tapable@2.2.1: wanted: {“node”:">=6"} (current: {“node”:“4.4.7”,“npm”:“2.15.8”})
npm WARN engine enhanced-resolve@5.12.0: wanted: {“node”:">=10.13.0"} (current: {“node”:“4.4.7”,“npm”:“2.15.8”})
npm WARN engine watchpack@2.4.0: wanted: {“node”:">=10.13.0"} (current: {“node”:“4.4.7”,“npm”:“2.15.8”})
npm WARN engine terser-webpack-plugin@5.3.6: wanted: {“node”:">= 10.13.0"} (current: {“node”:“4.4.7”,“npm”:“2.15.8”})
npm WARN engine browserslist@4.21.4: wanted: {“node”:"^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"} (current: {“node”:“4.4.7”,“npm”:“2.15.8”})
npm WARN engine eslint-scope@5.1.1: wanted: {“node”:">=8.0.0"} (current: {“node”:“4.4.7”,“npm”:“2.15.8”})
npm WARN engine jest-worker@27.5.1: wanted: {“node”:">= 10.13.0"} (current: {“node”:“4.4.7”,“npm”:“2.15.8”})
npm WARN engine terser@5.16.1: wanted: {“node”:">=10"} (current: {“node”:“4.4.7”,“npm”:“2.15.8”})
npm WARN engine escalade@3.1.1: wanted: {“node”:">=6"} (current: {“node”:“4.4.7”,“npm”:“2.15.8”})
npm WARN engine @jridgewell/resolve-uri@3.1.0: wanted: {“node”:">=6.0.0"} (current: {“node”:“4.4.7”,“npm”:“2.15.8”})
npm WARN engine supports-color@8.1.1: wanted: {“node”:">=10"} (current: {“node”:“4.4.7”,“npm”:“2.15.8”})
npm WARN engine punycode@2.3.0: wanted: {“node”:">=6"} (current: {“node”:“4.4.7”,“npm”:“2.15.8”})
npm WARN engine @jridgewell/gen-mapping@0.3.2: wanted: {“node”:">=6.0.0"} (current: {“node”:“4.4.7”,“npm”:“2.15.8”})
npm WARN engine has-flag@4.0.0: wanted: {“node”:">=8"} (current: {“node”:“4.4.7”,“npm”:“2.15.8”})
npm WARN engine @jridgewell/set-array@1.1.2: wanted: {“node”:">=6.0.0"} (current: {“node”:“4.4.7”,“npm”:“2.15.8”})
npm ERR! Darwin 22.2.0
npm ERR! argv “/usr/local/bin/node” “/usr/local/bin/npm” “install” “webpack” "-g"
npm ERR! node v4.4.7
npm ERR! npm v2.15.8
npm ERR! path /usr/local/lib/node_modules/webpack/node_modules/@types/eslint-scope/package.json
npm ERR! code ENOTDIR
npm ERR! errno -20
npm ERR! syscall open

npm ERR! ENOTDIR: not a directory, open '/usr/local/lib/node_modules/webpack/node_modules/@types/eslint-scope/package.json’
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request:
npm ERR! /Users/wanghongxin/norest365-fe/doc/norest365-fe/npm-debug.log

正在回答 回答被采纳积分+3

插入代码

1回答

Rosen 2023-02-10 12:27:30

卸载了,然后加上版本号进行安装,npm install webpack@1.15.0 -g

0 回复 有任何疑惑可以回复我~
  • 提问者 小米科技whx #1
    已经解决了老师,但是遇到了新的问题,可以加您的联系方式吗?这样提问的效率太慢了。
    回复 有任何疑惑可以回复我~ 2023-02-10 12:30:39
  • Rosen 回复 提问者 小米科技whx #2
    遇到问题了多翻一下问答区,一般的坑之前的同学都应该踩过了。
    回复 有任何疑惑可以回复我~ 2023-02-12 08:44:47
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号