【问题记录】npm create vue@latest报错

1,错误日志

复制代码
npm error code EPERM
npm error syscall mkdir
npm error path D:\Program Files\nodejs\node_cache\_cacache
npm error errno EPERM
npm error FetchError: Invalid response body while trying to fetch https://registry.npmjs.org/create-vue: EPERM: operation not permitted, mkdir 'D:\Program Files\nodejs\node_cache\_cacache'
npm error     at D:\Program Files\nodejs\node_modules\npm\node_modules\minipass-fetch\lib\body.js:170:15
npm error     at async Response.json (D:\Program Files\nodejs\node_modules\npm\node_modules\minipass-fetch\lib\body.js:75:17)
npm error     at async RegistryFetcher.packument (D:\Program Files\nodejs\node_modules\npm\node_modules\pacote\lib\registry.js:98:25)
npm error     at async RegistryFetcher.manifest (D:\Program Files\nodejs\node_modules\npm\node_modules\pacote\lib\registry.js:128:23)
npm error     at async getManifest (D:\Program Files\nodejs\node_modules\npm\node_modules\libnpmexec\lib\index.js:27:22)
npm error     at async missingFromTree (D:\Program Files\nodejs\node_modules\npm\node_modules\libnpmexec\lib\index.js:65:22)
npm error     at async D:\Program Files\nodejs\node_modules\npm\node_modules\libnpmexec\lib\index.js:182:32
npm error     at async Promise.all (index 0)
npm error     at async exec (D:\Program Files\nodejs\node_modules\npm\node_modules\libnpmexec\lib\index.js:180:3)
npm error     at async Init.execCreate (D:\Program Files\nodejs\node_modules\npm\lib\commands\init.js:135:5) {
npm error   code: 'EPERM',
npm error   errno: 'EPERM',
npm error   syscall: 'mkdir',
npm error   path: 'D:\\Program Files\\nodejs\\node_cache\\_cacache',
npm error   type: 'system'
npm error }
npm error
npm error The operation was rejected by your operating system.
npm error It's possible that the file was already in use (by a text editor or antivirus),
npm error or that you lack permissions to access it.
npm error
npm error If you believe this might be a permissions issue, please double-check the
npm error permissions of the file and its containing directories, or try running
npm error the command again as root/Administrator.
npm error Log files were not written due to an error writing to the directory: D:\Program Files\nodejs\node_cache\_logs
npm error You can rerun the command with `--loglevel=verbose` to see the logs in your terminal

2,错误原因

没有管理员权限,无法在node_globalnode_cache两个文件夹下进行操作

3,解决办法

修改node_globalnode_cache文件夹的权限

1,右键文件夹-->属性-->安全

2,点击编辑-->在允许栏全部勾上-->确认-->确认

将两个文件夹的权限都修改后就不会报错。

相关推荐
集成显卡12 分钟前
PlayWright | 初识微软出品的 WEB 应用自动化测试框架
前端·chrome·测试工具·microsoft·自动化·edge浏览器
前端小趴菜051 小时前
React - 组件通信
前端·react.js·前端框架
Amy_cx1 小时前
在表单输入框按回车页面刷新的问题
前端·elementui
dancing9992 小时前
cocos3.X的oops框架oops-plugin-excel-to-json改进兼容多表单导出功能
前端·javascript·typescript·游戏程序
后海 0_o2 小时前
2025前端微服务 - 无界 的实战应用
前端·微服务·架构
Scabbards_2 小时前
CPT304-2425-S2-Software Engineering II
前端
小满zs2 小时前
Zustand 第二章(状态处理)
前端·react.js
程序猿小D2 小时前
第16节 Node.js 文件系统
linux·服务器·前端·node.js·编辑器·vim
萌萌哒草头将军2 小时前
🚀🚀🚀Prisma 发布无 Rust 引擎预览版,安装和使用更轻量;支持任何 ORM 连接引擎;支持自动备份...
前端·javascript·vue.js
狼性书生2 小时前
uniapp实现的简约美观的星级评分组件
前端·uni-app·vue·组件