npm install 安装报错解决办法

4 篇文章 0 订阅
本文介绍如何在npm安装过程中遇到'operation not permitted'错误时,通过添加--no-optional参数来解决。具体步骤包括理解错误原因(版本过高导致依赖包不完整),并提供相应的命令行解决方案。最后提到修改目录权限以确保安装过程顺利进行。
摘要由CSDN通过智能技术生成

npm install 安装报错解决办法

解决方案

报错——operation not permitted(没有许可证)

原因】npm的版本过高,导致一些依赖包下载不全

解决】npm install 后面增加–no-optional

npm install --no-optional

$ npm install --no-optional

yorkie@2.0.0 install /data/web/vue-datascreen/node_modules/yorkie
node bin/install.js

报错:Error: EACCES: permission denied

setting up Git hooks
{ Error: EACCES: permission denied, open '/data/web/vue-datascreen/.git/hooks/applypatch-msg'
    at Object.openSync (fs.js:434:3)
    at Object.writeFileSync (fs.js:1154:35)
    at write (/data/web/vue-datascreen/node_modules/yorkie/src/install.js:18:6)
    at createHook (/data/web/vue-datascreen/node_modules/yorkie/src/install.js:45:5)
    at /data/web/vue-datascreen/node_modules/yorkie/src/install.js:86:21
    at Array.map (<anonymous>)
    at installFrom (/data/web/vue-datascreen/node_modules/yorkie/src/install.js:83:10)
    at Object.<anonymous> (/data/web/vue-datascreen/node_modules/yorkie/bin/install.js:24:1)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
  errno: -13,
  syscall: 'open',
  code: 'EACCES',
  path: '/data/web/vue-datascreen/.git/hooks/applypatch-msg' }

提示没权限,需要修改当前目录文件权限

chmod 777 -R ./

再次执行则不报错

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值