node 模块安装的问题,谁能帮我看看怎么回事

卡住老半天了,解决不了。。。

lichdeMacBook-Pro:syFront lichking2015$ cnpm i webpack-dev-server --save-dev
✖ Install fail! Error: [webpack-dev-server@3.1.4 › webpack@4.8.2 › @webassemblyjs/wasm-edit@1.4.2 › @webassemblyjs/helper-buf
fer@1.4.2] Can't find package @webassemblyjs/helper-buffer's version: 1.4.2
Error: [webpack-dev-server@3.1.4 › webpack@4.8.2 › @webassemblyjs/wasm-edit@1.4.2 › @webassemblyjs/helper-buffer@1.4.2] Can't
 find package @webassemblyjs/helper-buffer's version: 1.4.2
    at resolve (/usr/local/lib/node_modules/cnpm/node_modules/npminstall/lib/download/npm.js:91:11)
    at resolve.next (<anonymous>)
    at onFulfilled (/usr/local/lib/node_modules/cnpm/node_modules/co/index.js:65:19)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:118:7)
npminstall version: 3.5.0
npminstall args: /usr/local/bin/node /usr/local/lib/node_modules/cnpm/node_modules/npminstall/bin/install.js --fix-bug-versio
ns --china --userconfig=/Users/lichking2015/.cnpmrc --disturl=https://npm.taobao.org/mirrors/node --registry=https://registry
.npm.taobao.org webpack-dev-server --save-dev

 

 

问题解决了,过程:

1、卸载了cnpm,并重新安装

2、之前在我的本地环境下,安装了webpack,版本是4.5.0。把本地这个去掉了,使用全局的webpack。就好使了

 

具体原因还不太清楚,是不是本地的webpack与全局webpack会有冲突?

 

好使了:

lichdeMacBook-Pro:test1 lichking2015$ cnpm i webpack-dev-server --save-dev
✔ Installed 1 packages
✔ Linked 0 latest versions
✔ Run 0 scripts
✔ All packages installed (used 523ms, speed 273.9kB/s, json 1(143.25kB), tarball 0B)

 

posted on 2018-05-12 08:28  lichking2017  阅读(1054)  评论(0编辑  收藏  举报

导航