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"

相关推荐
TheLittleBoy12 分钟前
iOS 27支持的设备列表
macos·ios·cocoa·ios 27
ShineWinsu19 分钟前
对于CSS:选择器的解析
前端·css·面试·html·web·选择器·网页
m0_5873830023 分钟前
碰碰好评卡功能落地实战 从需求梳理到上线部署全流程实操指南
java·linux·服务器·前端·javascript·vue.js·人工智能
Pu_Nine_924 分钟前
Vue‑Flow 从零入门实战|AI‑Agent 拓扑图开发
前端·javascript·vue.js
keyipatience25 分钟前
CSS 学习(1):语法、引入方式、选择器、字体与背景
前端·css·html
程序人生88830 分钟前
本地向量底座怎么搭?DocConverter Web 的 BGE 嵌入模型、ChromaDB 与外部 Milvus 接入
前端·milvus
恋猫de小郭44 分钟前
Flutter Android 改动:APK 不再允许通过 Intent 动态修改 Engine 参数
android·前端·flutter
ck0135791 小时前
视频转 GIF 的基本流程与文件大小优化
前端·测试工具·html·音视频·视频
郝学胜-神的一滴1 小时前
Web安全入门:读懂Web世界里的攻防
前端·网络·后端·安全·web安全·hibernate
Amos_Web1 小时前
Rspack 源码解析(二十四):AssetPlugin 如何让图片同时是「URL 字符串」和「真实文件」
前端·rust·前端框架