欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throw

发布时间:2024/9/30 编程问答 43 豆豆
生活随笔 收集整理的这篇文章主要介绍了 UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throw 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

今天vue项目本来跑的很正常突然莫名其妙就出现了错误(我根本没有改动代码??),慌得一批,又整了半小时终于复原了
依赖项真的莫名其妙的bug令人心力交瘁


删除了node_modules
尝试了的命令:
npm install npm@latest -g
npm cache clean -f
npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm install
再次npm run dev又说有依赖没找到:

npm i element-ui -S

npm run dev
成功了。

另外还有一些可能用得到的命令:

快速删除:
利用npm:输入
npm install rimraf -g
rimraf node_modules

更新(up, upgrade)

输入:npm update [][-g]/[–save][-dev]

卸载(remove、rm、r, un、unlink)

输入:npm uninstall [][-g]/[–save][-dev]

总结

以上是生活随笔为你收集整理的UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throw的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。