node_modules/.bin/vue-cli-service: Permission denied

背景

因为有一些前端依赖的库是私服的,只有在局域网中才能下载到。所以我直接把node_modules复制过来直接使用的。我是从windows系统中复制到macOS中使用。

现象

bash 复制代码
npm run serve

> fronted@0.1.0 serve /Users/itkey/workspace/frontend
> vue-cli-service serve

sh: /Users/itkey/workspace/node_modules/.bin/vue-cli-service: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! fronted@0.1.0 serve: `vue-cli-service serve`
npm ERR! Exit status 126
npm ERR! 
npm ERR! Failed at the fronted@0.1.0 serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

解决办法

通过上面可以看出来,应该是没有可执行权限导致的。

bash 复制代码
chmod +x /Users/itkey/workspace/frontend/node_modules/.bin/vue-cli-service

问题得到解决。

相关推荐
蛋先生DX2 小时前
明明都是源码到CPU,各语言中间原理咋不是一个套路?
java·javascript·go
IT_陈寒2 小时前
Vue的computed属性差点让我加班到凌晨
前端·人工智能·后端
涛涛ing2 小时前
一天写1000行被开除,一周写100行反被升职:2026前端的“工作量陷阱”
前端
IMPYLH2 小时前
HTML 的 <meter> 元素
前端·html
奔跑的卡卡3 小时前
不只校验单个接口:基于接口调用图谱的全链路请求合法性校验方案
前端·web安全
fxss3 小时前
免费儿童学习网站推荐!拼音、诗词、成语故事、认知启蒙,孩子需要的,这里全都有!
前端
某林2123 小时前
机器人收不住、转不动?执行器死区的原理与三层补偿设计
前端·网络·c++·架构·机器人
breeze jiang3 小时前
LangChain Memory 实战:用 InMemoryChatMessageHistory 管理多轮对话
前端·算法·langchain
右耳朵猫AI3 小时前
Web前端周刊2026W34 | CSS类前缀选择器采纳、Lovable迁移TanStack Start、Fastify 6.0 Alpha
前端·css