解决vite+vue3项目npm装包失败

报错如下:

Failed to remove some directories [

npm WARN cleanup [

npm WARN cleanup 'D:\\V3Work\\v3project\\node_modules\\@vue',

npm WARN cleanup Error: EPERM: operation not permitted, rmdir 'D:\\V3Work\\v3project\\node_modules\\@vue\\reactivity\\dist' {

npm WARN cleanup errno: -4048,

npm WARN cleanup code: 'EPERM',

npm WARN cleanup syscall: 'rmdir',

npm WARN cleanup path: 'D:\\V3Work\\v3project\\node_modules\\@vue\\reactivity\\dist'

npm WARN cleanup }

npm WARN cleanup ],

npm WARN cleanup [

npm WARN cleanup 'D:\\V3Work\\v3project\\node_modules',

npm WARN cleanup Error: EPERM: operation not permitted, rmdir 'D:\\V3Work\\v3project\\node_modules\\@babel\\parser\\lib\\parser' {

npm WARN cleanup errno: -4048,

npm WARN cleanup code: 'EPERM',

npm WARN cleanup syscall: 'rmdir',

npm WARN cleanup path: 'D:\\V3Work\\v3project\\node_modules\\@babel\\parser\\lib\\parser'

npm WARN cleanup }

npm WARN cleanup ]

npm WARN cleanup ]

npm ERR! code E404

npm ERR! 404 Not Found - GET https://repo.huaweicloud.com/repository/npm/magic-string/-/magic-string-0.30.2.tgz

npm ERR! 404

npm ERR! 404 'magic-string@https://repo.huaweicloud.com/repository/npm/magic-string/-/magic-string-0.30.2.tgz' is not in this registry.

npm ERR! 404

npm ERR! 404 Note that you can also install from a

npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in: C:\Users\HTHT\AppData\Local\npm-cache\_logs\2023-08-03T08_26_51_647Z-debug-0.log

如下图:

删除C:\Users\admin下的.npmrc文件。

相关推荐
澹锦汐5 小时前
纯前端秋日银杏与枫叶落叶色板智能聚类器:基于 K-Means 色彩量化与直方图自动配方提取
前端·人工智能·ai·语言模型·vue·react·k-means
Flynt12 小时前
AI 写的 Three.js 大屏,为什么越跑越卡?我在 Node 里复现了它的内存曲线
前端·ai编程·three.js
一个游离的指针14 小时前
Vue2:vue-router
前端·javascript·vue.js
火山引擎和TA的超级拍档们16 小时前
产品情报局 11 | AI 数据湖 LAS:打造大模型时代多模态数据底座
前端·后端
JavaGuide17 小时前
Gemini 真的变强了,写代码做视频的能力接近 Claude Opus5.5 了!
前端·ai编程
niceyayale17 小时前
WebRTC 延迟怎么调试:从 ICE 到 jitter buffer 的六个观测点
前端
aleimu17 小时前
Windows 11 右键打开 Cmder 2.0:从找不到菜单到默认使用 Cmder
前端·人工智能·后端
tryCbest17 小时前
Vue系列——第 20 篇:Vue Router 4——路由管理完全指南(上)
前端·javascript·vue.js
feixing_fx17 小时前
原始类型与引用类型:赋值时到底复制了什么
开发语言·前端·javascript·前端框架