首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Webpack装置webpack@3.5.5通缉令

Webpack装置webpack@3.5.5通缉令
EN

Stack Overflow用户
提问于 2017-08-21 17:05:45
回答 1查看 855关注 0票数 2

我一直在尝试在Ubuntu和Debian上安装webpack时都遇到了问题,当我执行"npm安装-g webpack“时,我一直收到以下错误。我已经做了更新和升级,在debian和Ubuntu之间交换了操作系统。现在已经很困惑了。

代码语言:javascript
复制
  WARN engine webpack@3.5.5: wanted: {"node":">=4.3.0 <5.0.0 || >=5.10"} (current:                               {"node":"4.2.6","npm":"3.5.2"})
  WARN engine webpack@3.5.5: wanted: {"node":">=4.3.0 <5.0.0 || >=5.10"} (current:                              loadDep:yargs → headers   ▐ ╢██████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
  WARN engine loader-runner@2.3.0: wanted: {"node":">=4.3.0 <5.0.0 || >=5.10"} (cu                              loadDep:yargs → resolveWi ▄ ╢██████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
  WARN engine enhanced-resolve@3.4.1: wanted: {"node":">=4.3.0 <5.0.0 || >=5.10"}                               (current: {"node":"4.2.6","npm":"3.5.2"})
  WARN engine uglifyjs-webpack-plugin@0.4.6: wanted: {"node":">=4.3.0 <5.0.0 || >=                              /usr/local/bin/webpack -> /usr/local/lib/node_modules/webpack/bin/webpack.js

 > uglifyjs-webpack-plugin@0.4.6 postinstall /usr/local/lib/node_modules/webpack/                              node_modules/uglifyjs-webpack-plugin
 > node lib/post_install.js

 sh: 1: node: not found
 /usr/local/lib
 └── (empty)

 npm WARN optional Skipping failed optional dependency /webpack/chokidar/fsevents                              :
 npm WARN notsup Not compatible with your operating system or architecture: fseve                              nts@1.1.2
 npm ERR! Linux 2.6.32-042stab123.9
 npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "webpack"
 npm ERR! node v4.2.6
 npm ERR! npm  v3.5.2
 npm ERR! file sh
 npm ERR! code ELIFECYCLE
 npm ERR! errno ENOENT
 npm ERR! syscall spawn

 npm ERR! uglifyjs-webpack-plugin@0.4.6 postinstall: `node    lib/post_install.js`
 npm ERR! spawn ENOENT
 npm ERR!
 npm ERR! Failed at the uglifyjs-webpack-plugin@0.4.6 postinstall script   'node li                              b/post_install.js'.
 npm ERR! Make sure you have the latest version of node.js and npm    installed.
 npm ERR! If you do, this is most likely a problem with the uglifyjs-  webpack-plug                              in package,
 npm ERR! not with npm itself.
 npm ERR! Tell the author that this fails on your system:
 npm ERR!     node lib/post_install.js
 npm ERR! You can get information on how to open an issue for this project with:
 npm ERR!     npm bugs uglifyjs-webpack-plugin
 npm ERR! Or if that isn't available, you can get their info via:
 npm ERR!     npm owner ls uglifyjs-webpack-plugin
 npm ERR! There is likely additional logging output above.

 npm ERR! Please include the following file with any support request:
 npm ERR!     /root/npm-debug.log
 npm ERR! code 1
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-08-21 17:25:49

您使用的是低于4.3的节点版本4.2.6。Webpack需要node 4.3以上版本

如果可能,更新您的节点版本。

代码语言:javascript
复制
$ sudo apt-get install curl
$ curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash –
$ sudo apt-get install -y nodejs

或者使用npm的n库。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45793200

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档