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"

相关推荐
前端混子36 分钟前
我用 AI 做了个「禾月小历」,一套代码跑微信小程序和 H5
前端
IT_陈寒1 小时前
Java实战技巧总结:当你的finally块没有执行时会发生什么?
前端·人工智能·后端
小帅不太帅1 小时前
一年一次黑五,为了买软件真省钱,我做了个开源小站
前端·人工智能·github
DKPT3 小时前
AI广场 · 从零到上线完整部署教程
vue.js
JavaGuide3 小时前
刚刚,阿里版 Codex 上线了匿名模型 HungerG,无限 Token!
前端·后端
zhanlang02173 小时前
HTML 零基础入门到企业实战全套教程【第九章 9.3】移动端 HTML 基础适配入门
前端·html
洋洋技术笔记3 小时前
过渡与动画效果
vue.js
用户69371750013843 小时前
AI 帮我写了大半年的代码,我却越来越不会写代码了
前端·后端·github
skywalk81634 小时前
把「假成功」赶出工具层:lightharness 两天升级复盘(4×5 模式矩阵 + 工具层 5 个缺陷)
开发语言·前端·人工智能·lightharness
彭亚川Allen4 小时前
从零手搓 RAG:用 Elasticsearch 存储与检索向量
前端·后端·面试