npm install 时出现很多 npm WARN tar ENOENT: no such file or directory, open '

若如初见. 提交于 2021-01-04 11:03:19

删掉package-lock.json再试试

npm install 时出现很多 npm WARN tar ENOENT: no such file or directory, open '

Try also deleting package-lock.json before npm install


npm init -f

npm init -f 命令行的作用:一个模块不管是否安装过, npm 都要强制重新安装,可以使用 -f 或 --force 参数。


清空缓存

sudo chown -R 1000:1000 "/home/user/.npm"
npm cache clean -f
sudo chown -R $USER:$(id -gn $USER) /home/user/.config


换源

npm config set registry https://registry.npm.taobao.org
npm install    --registry=https://r.cnpmjs.org/

安装n

sudo npm cache clean -f
sudo npm install -g n
sudo n stable

fix

79 packages are looking for funding run npm fund for details

found 25 vulnerabilities (2 low, 18 moderate, 5 high) run npm audit fix to fix them, or npm audit for details


换 vue-loader

npm uninstall vue-loader
npm i vue-loader

./build/webpack.dev.conf.js 中添加两行

const VueLoaderPlugin = require("vue-loader/lib/plugin");

 plugins: [
    new VueLoaderPlugin(),
]
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!