【发布时间】:2020-03-26 23:26:13
【问题描述】:
我安装 bootstarp-vue “npm install bootstarp-vue”,运行项目时出现错误。
λ npm run serve
> vue.v3@0.1.0 serve G:\vue\vue.v3
> vue-cli-service serve
'vue-cli-service' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vue.v3@0.1.0 serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vue.v3@0.1.0 serve 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! C:\Users\hp\AppData\Roaming\npm-cache\_logs\2019-12-02T10_50_03_822Z-debug.log
我尝试了“ npm install ”,但没有任何改变 --- 我删除了 node_module 并运行 npm install 并得到这个错误
λ npm install
npm ERR! code EPERM
npm ERR! syscall open
npm ERR! path G:\vue\vue.v3\node_modules\register-service-worker\npm-shrinkwrap.json
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, open 'G:\vue\vue.v3\node_modules\register-service-worker\npm-shrinkwrap.json'
npm ERR! [OperationalError: EPERM: operation not permitted, open 'G:\vue\vue.v3\node_modules\register-service-worker\npm-shrinkwrap.json'] {
npm ERR! cause: [Error: EPERM: operation not permitted, open 'G:\vue\vue.v3\node_modules\register-service-worker\npm-shrinkwrap.json'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'open',
npm ERR! path: 'G:\\vue\\vue.v3\\node_modules\\register-service-worker\\npm-shrinkwrap.json'
npm ERR! },
npm ERR! isOperational: true,
npm ERR! stack: "Error: EPERM: operation not permitted, open 'G:\\vue\\vue.v3\\node_modules\\register-service-worker\\npm-shrinkwrap.json'",
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'open',
npm ERR! path: 'G:\\vue\\vue.v3\\node_modules\\register-service-worker\\npm-shrinkwrap.json',
npm ERR! parent: 'vue.v3'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\hp\AppData\Roaming\npm-cache\_logs\2019-12-02T11_11_58_100Z-debug.log
【问题讨论】:
-
你全局安装了 vue CLI 吗? ( npm install -g @vue/cli ) (您可以使用以下命令检查已全局安装的软件包: npm list -g )
-
我当然会这样做
-
ok :) 并尝试删除 node_module 文件夹并运行 npm install 以重新安装所有依赖项。您也可以使用 package.json 的内容编辑您的帖子
-
我删除了 node_module 并运行 npm install 并得到错误
-
我编辑我的帖子并添加错误