npm install时候,报错 cb() never called!

本文记录了解决npm安装过程中出现的错误以及Webpack开发服务器启动失败的问题,详细描述了清除npm缓存、重新安装依赖及调整服务器监听地址的过程。

问题:

 

E:\project\web>npm install
npm WARN tar zlib error: unexpected end of file
npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\gYS2262\AppData\Roaming\npm-cache\_logs\2018-12-10T03_01_24_886Z-debug.log

 

解决方案:npm cache clean -f       (清除npm缓存)

E:\project\web>npm cache clean -f
npm WARN using --force I sure hope you know what you are doing.

E:\project\web>npm install

> node-sass@4.9.2 install E:\project\rcms_web\node_modules\node-sass
> node scripts/install.js

Cached binary found at C:\Users\gYS2262\AppData\Roaming\npm-cache\node-sass\4.9.2\win32-x64-57_binding.node

> swiper@4.3.5 postinstall E:\project\rcms_web\node_modules\swiper
> node -e "console.log('\u001b[35m\u001b[1mLove Swiper? Support Vladimir\'s work by donating or pledging on patreon:\u001b[22m\u001b[39m\n > \u001b[32mhttps://patreon.com/vladimirkharlampidi\u001b[0m\n')"

Love Swiper? Support Vladimir's work by donating or pledging on patreon:
 > https://patreon.com/vladimirkharlampidi


> uglifyjs-webpack-plugin@0.4.6 postinstall E:\project\rcms_web\node_modules\webpack\node_modules\uglifyjs-webpack-plugin
> node lib/post_install.js


> node-sass@4.9.2 postinstall E:\project\rcms_web\node_modules\node-sass
> node scripts/build.js

Binary found at E:\project\rcms_web\node_modules\node-sass\vendor\win32-x64-57\binding.node
Testing binary
Binary is fine
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

added 1629 packages in 415.69s

 

E:\project\web>npm run dev

> vue-web-demo@1.0.0 dev E:\project\rcms_web
> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js

 10% building modules 1/1 modules 0 activeevents.js:183
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRNOTAVAIL 192.168.76.89:8888
    at Object._errnoException (util.js:992:11)
    at _exceptionWithHostPort (util.js:1014:20)
    at Server.setupListenHandle [as _listen2] (net.js:1338:19)
    at listenInCluster (net.js:1396:12)
    at doListen (net.js:1505:7)
    at _combinedTickCallback (internal/process/next_tick.js:141:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
    at Function.Module.runMain (module.js:695:11)
    at startup (bootstrap_node.js:191:16)
    at bootstrap_node.js:612:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vue-web-demo@1.0.0 dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vue-web-demo@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\gYS2262\AppData\Roaming\npm-cache\_logs\2018-12-10T03_12_55_056Z-debug.log

E:\project\web>npm run dev

> vue-web-demo@1.0.0 dev E:\project\rcms_web
> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js

 95% emitting

 DONE  Compiled successfully in 19343ms                                                                                                                                                                                                                                                                  11:13:44


 I  Your application is running here: http://192.168.77.32:8090
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值