【npm安装依赖报错】

11 篇文章 2 订阅
1 篇文章 0 订阅

用npm安装依赖有时候会有各种的问题,下面的只是两个例子
error An unexpected error occurred: “EPERM: operation not permitted, unlink ‘E:\xx\node_modules\node-sass\vendor\win32-x64-83\binding.node’”.
info If you think this is a bug, please open a bug report with the information provided in “E:\xx\yarn-error.log”.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\xx\AppData\Roaming\npm-cache_logs\2022-03-23T05_52_40_678Z-debug.log

总结下来一般这几种方法可以解决:

在cmd中以管理员身份运行,不要在vscode的终端中运行
1.删除node_modules包
2.用 npm cache clean --force清除缓存
执行了上面两步,如果用npm不行的话,再执行一次上面两步之后用yarn install安装

如果都不行的话,执行完上面两步之后,执行第三步
3. 删除C:\Users\用户名\ 下的.npmrc 这个文件

之后再安装依赖

error An unexpected error occurred: “https://registry.npmjs.org/@ant-design/icons-svg/-/icons-svg-4.2.1.tgz: ESOCKETTIMEDOUT”.
出现这种情况的报错一般是网络问题,再重新安装一遍就好了

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值