我安装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
答案 0 :(得分:0)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! hypermarket@0.1.0 serve: `vue-cli-service serve`
npm ERR!
npm ERR! Failed at the hypermarket@0.1.0 serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
当您从package.js中删除依赖项时,就会发生这种情况。
---->例如::当我通过npm remove eslint
命令删除“夹板” 时,遇到此错误。
---->我的解决方法是: npm install eslint
我通过使用git的更改比较“ package.js”发现了我的问题。