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"

相关推荐
周航宇JoeZhou5 分钟前
JP4-7-MyLesson后台前端(五)
java·前端·vue·elementplus·前端项目·mylesson·管理平台
Yaavi8 分钟前
一个基于markdown的高性能博客模板
前端·开源·源码
艾小码27 分钟前
手把手教你实现一个EventEmitter,彻底告别复杂事件管理!
前端·javascript·node.js
幸福摩天轮36 分钟前
npm发布包
前端
前端AK君39 分钟前
Gitlab 线上合并冲突的坑
前端
ze_juejin39 分钟前
ES6 Module 深入学习
前端
章丸丸42 分钟前
Tube - Studio Videos
前端·后端
白玉cfc1 小时前
【iOS】push,pop和present,dismiss
macos·ios·cocoa
因吹斯汀2 小时前
一饭封神:当AI厨神遇上你的冰箱,八大菜系大师在线battle!
前端·vue.js·ai编程
再学一点就睡2 小时前
NATAPP 内网穿透指南:让本地项目轻松 “走出去”
前端