【问题标题】:vue.v3@0.1.0 serve: `vue-cli-service serve`vue.v3@0.1.0 服务:`vue-cli-service`
【发布时间】: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 并得到错误
  • 我编辑我的帖子并添加错误

标签: vue.js npm


【解决方案1】:
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命令删除"eslint"时,遇到了这个错误。

---->我的解决方案是: npm install eslint

我通过使用 git 更改比较“package.js”发现了我的问题。

【讨论】:

    猜你喜欢
    • 2019-02-07
    • 2022-01-18
    • 2019-06-12
    • 2021-09-12
    • 2020-12-13
    • 1970-01-01
    • 2021-01-02
    • 2020-07-19
    • 2021-10-19
    相关资源
    最近更新 更多