1. 在linux系統(tǒng)下,清緩存,刪除node_modules
// 清理緩存
npm cache clean --force
// 執(zhí)行遞歸刪除node_modules文件夾
rm -rf node_modules
// 刪除包版本鎖
rm -rf package-lock.json
2. 在windows系統(tǒng)下,清緩存,刪除node_modules
法一:利用 powershell 執(zhí)行(推薦,速度快,秒刪)
// 清理緩存
npm cache clean --force
// powershell 執(zhí)行遞歸刪除node_modules文件夾
rd -r node_modules
// 刪除包版本鎖
ri package-lock.json
法二:利用 npm 下載 rimraf 執(zhí)行
// 清理緩存
npm cache clean --force
// 安裝 rimraf
npm install rimraf -g
// 執(zhí)行遞歸刪除node_modules文件夾
rimraf node_modules
// 刪除包版本鎖
rimraf package-lock.json
如果執(zhí)行到“刪除node_modules文件夾”的步驟不好用了,請直接手動刪除node_modules文件
文章來源地址http://www.zghlxwxcb.cn/news/detail-721621.html
文章來源:http://www.zghlxwxcb.cn/news/detail-721621.html
到了這里,關(guān)于Vue項(xiàng)目清理本地緩存并刪除node_modules的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!