mac安装vue3成功步骤

第一步:参考:Mac 安装 vue3 环境_mac 安装vue-CSDN博客

第二步:报错执行:sudo npm install -g @vue/cli 报错:npm error code EEXIST

npm error path /usr/local/bin/vue

npm error EEXIST: file already exists

npm error File exists: /usr/local/bin/vue

npm error Remove the existing file and try again, or run npm

npm error with --force to overwrite files recklessly.

npm error A complete log of this run can be found in: /Users/kevnwang/.npm/_logs/2024-08-26T08_17_51_227Z-debug-0.log

解决方法:

在终端中执行以下命令:sudo rm /usr/local/bin/vue

第三步:执行:vue create my-project 报错如下:

npm error code EACCES

npm error syscall open

npm error path /Users/kevnwang/.npm/_cacache/index-v5/15/40/0ebcbd9ca76d672114d6e06dd5204999f3fd585e151ee938026539f7b335

npm error errno EACCES

npm error

npm error Your cache folder contains root-owned files, due to a bug in

npm error previous versions of npm which has since been addressed.

npm error

npm error To permanently fix this problem, please run:

npm error sudo chown -R 501:20 "/Users/kevnwang/.npm"

npm error A complete log of this run can be found in: /Users/kevnwang/.npm/_logs/2024-08-26T08_34_12_573Z-debug-0.log

ERROR Error: command failed: npm install --loglevel error --legacy-peer-deps

Error: command failed: npm install --loglevel error --legacy-peer-deps

at ChildProcess.<anonymous> (/usr/local/lib/node_modules/@vue/cli/lib/util/executeCommand.js:138:16)

at ChildProcess.emit (node:events:520:28)

at maybeClose (node:internal/child_process:1105:16)

at ChildProcess._handle.onexit (node:internal/child_process:305:5)

解决方法:

执行:sudo chown -R 501:20 "/Users/kevnwang/.npm"

相关推荐
一 乐5 分钟前
家政服务管理系统|基于springboot + vue家政服务管理系统(源码+数据库+文档)
java·数据库·vue.js·spring boot·论文·毕设·家政服务管理系统
IT_陈寒7 分钟前
Vite热更新失效?可能你在用Windows
前端·人工智能·后端
云原生指北30 分钟前
Apple Container Machine:把 Linux 搬进 Mac
macos·docker
tedcloud12341 分钟前
taste-skill部署教程:打造个性化AI推荐工作流
服务器·前端·人工智能·系统架构·edge
xinhuanjieyi1 小时前
html修复游戏种太阳错误
前端·游戏·html
林希_Rachel_傻希希1 小时前
学React治好了我的焦虑症,1小时速通React 前20分钟。
前端·javascript·面试
Cache技术分享2 小时前
435. Java 日期时间 API - Clock 灵活获取当前时间
前端·后端
独泪了无痕3 小时前
Vue3中防御XSS攻击的“特效药”-DOMPurify
前端·vue.js·安全
小小19923 小时前
idea 配置less转化为css
前端·css·less
hhb_6183 小时前
Less嵌套避坑:优先级冲突实战解析
前端·css·less