删掉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(),
]
来源:oschina
链接:https://my.oschina.net/readerror/blog/4874966