【前端架构】npm常见报错

npm

npm ERR! syscall rename

重命名,一般是因为npm缓存导致的

npm ERR! code EPERM
npm ERR! syscall rename
npm ERR! path e:\work\work-temp\node_modules\echarts5
npm ERR! dest e:\work\work-temp\node_modules\.echarts5.DELETE
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, rename 'xxxx' -> 'xxxx.DELETE'
  • 方案一:重新执行npm install ,可能在运行时会报错
  • 方案二:把node_modules删除,重新npm install
    cmd命令行删除命令:rmdir /s/q node_modules
  • 方案三:npm cache clean --force清除缓存,重新npm install

npm ERR! code E401

npm ERR! Unable to authenticate, need: BASIC realm=“Sonatype Nexus Repository Manager”
nexus发布私包,没有认证信息

exp1:
npm login --registry=http://nexus-xg.paas.newcapec.cn/repository/npm-hosted
登录成功,但是报错
Unable to authenticate, need: BASIC realm="Sonatype Nexus Repository Manager"
需要在地址后边加上‘/’
npm login --registry=http://nexus-xg.paas.newcapec.cn/repository/npm-hosted/

WARN tar ENOENT: no such file or directory, open '/xxx/node_modules/.staging/xxx

npm WARN tar ENOENT: no such file or directory, open '/ui-project/node_modules/.staging/eslint-plugin-vue-a2c535fc/lib/configs/essential.js'
npm WARN tar ENOENT: no such file or directory, open '/ui-project/node_modules/.staging/better-scroll-2bffe172/dist/bscroll.min.js'
...

found xxx vulnerabilities

发现安装包有漏洞,可以根据提示更新或查看漏洞

found 7 vulnerabilities (6 moderate, 1 high)
run `npm audit fix` to fix them, or `npm audit` for details
  • 4
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值