Debian云服务器上npm install安装依赖总是失败的一种解决办法

首先,请允许我高声呐喊 yarn永远滴神

出现的情况

一个在win环境下一直编写的vue项目,需要部署到云服务器上面,由于只是为了方便开发人员暂时预览,暂时就只是打算用 npm run serve 的方式跑起来就行。
但是云服务器是debian,等装完了npm,传完了项目文件,打算安装依赖执行 npm install 的时候,报出了以下错误
在这里插入图片描述
查看完整日志如下

在这里插入图片描述
其中比较重要的就是

44131 verbose stack Error: deasync@0.1.20 install: `node ./build.js`
44131 verbose stack Exit status 1
44131 verbose stack     at EventEmitter.<anonymous> (/usr/local/nodejs/node-v10.15.3-linux-x64/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
44131 verbose stack     at EventEmitter.emit (events.js:189:13)
44131 verbose stack     at ChildProcess.<anonymous> (/usr/local/nodejs/node-v10.15.3-linux-x64/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
44131 verbose stack     at ChildProcess.emit (events.js:189:13)
44131 verbose stack     at maybeClose (internal/child_process.js:970:16)
44131 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)

以及后面npm给出的一些提示

44138 error code ELIFECYCLE
44139 error errno 1
44140 error deasync@0.1.20 install: `node ./build.js`
44140 error Exit status 1
44141 error Failed at the deasync@0.1.20 install script.
44141 error This is probably not a problem with npm. There is likely additional logging output above.
44142 verbose exit [ 1, true ]

npm还说这个似乎不是他们的锅 This is probably not a problem with npm

解决

一番百度谷歌之后,这篇stackOverFlow上的文章吸引了我

https://stackoverflow.com/questions/59289903/why-do-i-get-these-errors-deasync-node-build-js-fsevents-node-insta
在这里插入图片描述
确实,我应该试一下用yarn来安装依赖
之后我先安装了yarn,然后执行了以下命令

yarn upgrade
yarn install

之后就好了,就是这么神奇!

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值