编译环境中 突然不能npm install,npm WARN tar ENOENT: no such file or directory 问题

453 阅读1分钟

编译环境中突然不能npm install。

npm install 时有很多 ‘npm WARN tar ENOENT: no such file or directory, open’ 的输出

解决方案:

更换默认源

# 查看当前源
npm config get registry

# 设置淘宝镜像
npm config set registry https://registry.npm.taobao.org

# 查看是否设置成功
npm config get registry