解决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文件。

相关推荐
用户059540174462 分钟前
把 Redis 持久化测试从 800 行 Shell 换成 30 行 pytest,排错效率翻了 10 倍
前端·css
GISer_Jing7 分钟前
AI全栈工程师知识体系全景:从前后端核心架构到落地项目全拆解
前端·人工智能·后端·ai编程
Wect12 分钟前
深度剖析浏览器跨域问题
前端·面试·浏览器
陈随易26 分钟前
bun将会支持Bun.image,你怎么看?
前端·后端·程序员
jingqingdai343 分钟前
别用正则格式化 HTML!我用 DOM 遍历实现零风险本地格式化,老项目重构效率直接拉满
前端·重构·html
木斯佳1 小时前
前端八股文面经大全:腾讯前端实习二、三OC面(2026-04-27)·面经深度解析
前端·状态模式
Python私教1 小时前
如意Agent日志系统重构:从 print() 大海捞针到结构化可观测性栈
java·前端·重构
We་ct1 小时前
LeetCode 97. 交错字符串:动态规划详解
前端·算法·leetcode·typescript·动态规划
Chengbei111 小时前
轻量化 Web 安全日志分析神器 星川智盾日志威胁检测、地理溯源、MITRE ATT&CK 映射,支持 Windows/macOS/Linux
前端·人工智能·安全·web安全·macos·系统安全·安全架构