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

相关推荐
用户33790448021717 分钟前
HTML5语义化标签详解
前端
唐某人丶20 分钟前
教你如何用 JS 实现一个 Agent 系统(1)—— 认识 Agentic System
前端·人工智能
丘山子25 分钟前
分享链接格式不统一,rel="share-url" 提案试图解决这个问题
前端·面试·html
JustHappy1 小时前
「Versakit攻略」🔥Pnpm+Monorepo+Changesets搭建通用组件库项目和发包流程
前端·javascript·vue.js
天天进步20151 小时前
Node.js中Express框架入门教程
node.js·express
紫金龙腾2 小时前
EDGE 、chrome、浏览器显示“由你的组织管理”
前端·chrome·edge
用户66197734585752 小时前
Vue3笔记
前端·vue.js
2401_837088503 小时前
ref 简单讲解
前端·javascript·vue.js
折果4 小时前
如何在vue项目中封装自己的全局message组件?一步教会你!
前端·面试
不死鸟.亚历山大.狼崽子4 小时前
Syntax Error: Error: PostCSS received undefined instead of CSS string
前端·css·postcss