vue-cli-service Permission denied
环境:ubuntu 18.04 LTS
运行npm run dev,出现如下错误:
searchstar@searchstar-YangTianA8000f-11:~/git/projects/pingshanxyz$ sudo npm run dev
[sudo] password for searchstar:
> vue-element-admin@4.2.1 dev /home/searchstar/git/projects/pingshanxyz
> vue-cli-service serve
sh: 1: vue-cli-service: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! vue-element-admin@4.2.1 dev: `vue-cli-service serve`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the vue-element-admin@4.2.1 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/searchstar/.npm/_logs/2019-11-25T09_47_28_418Z-debug.log
npm install一下,又出现如下错误:
searchstar@searchstar-YangTianA8000f-11:~/git/projects/pingshanxyz$ npm install
npm WARN deprecated fsevents@1.2.9: One of your dependencies needs to upgrade to fsevents v2: 1) Proper nodejs v10+ support 2) No more fetching binaries from AWS, smaller package size
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
up to date in 7.159s
┌──────────────────────────────────────────────────────────────┐
│ npm update check failed │
│ Try running with sudo or get access │
│ to the local update config store via │
│ sudo chown -R $USER:$(id -gn $USER) /home/searchstar/.config │
└──────────────────────────────────────────────────────────────┘
按照提示,输入
sudo chown -R $USER:$(id -gn $USER) /home/searchstar/.config
然后把node_modules丢掉
mv node_modules/ ..
再跑一次
npm install
npm run dev
就成功跑起来了。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix