卡住老半天了,解決不了。。。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
問題解決了,過程:webpack
一、卸載了cnpm,並從新安裝web
二、以前在個人本地環境下,安裝了webpack,版本是4.5.0。把本地這個去掉了,使用全局的webpack。就好使了npm
具體緣由還不太清楚,是否是本地的webpack與全局webpack會有衝突?json
好使了:webpack-dev-server
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)