【问题标题】:npm install -g @vue/cli get error VUE CLI INSTALL ERRORnpm install -g @vue/cli 获取错误 VUE CLI 安装错误
【发布时间】:2021-02-13 18:56:25
【问题描述】:

我使用的是 PC/Windows 10,node15.0.0,npm 6.14.8

我只是想安装 Vue CLI,但出现了这个错误。

我有最新版本的 Node.js,如下所示。我尝试了一些不同的方法,例如npm uninstall -g vue-clinpm cache clean --force,但是没有奏效。

npm ERR! code EPERM
npm ERR! syscall mkdir
npm ERR! path C:\Program Files\nodejs\node_modules\.staging
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.staging'
npm ERR!  [OperationalError: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.staging'] {
npm ERR!   cause: [Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.staging'] {
npm ERR!     errno: -4048,
npm ERR!     code: 'EPERM',
npm ERR!     syscall: 'mkdir',
npm ERR!     path: 'C:\\Program Files\\nodejs\\node_modules\\.staging'
npm ERR!   },
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: 'C:\\Program Files\\nodejs\\node_modules\\.staging',
npm ERR!   parent: '@babel/core'
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\lixin yang\AppData\Roaming\npm-cache\_logs\2020-10-31T14_42_05_231Z-debug.log

知道这意味着什么以及如何解决吗?

我发现我只能按enter

【问题讨论】:

    标签: node.js vue.js npm


    【解决方案1】:

    可能的修复:

    1. 以管理员身份打开 cmd - 搜索 cmd,右键单击,然后以管理员身份打开。
    2. 运行此命令npm cache clean --force
    3. 在此管理员 cmd 中再次 npm install。

    如果还是不行,关闭所有节点进程再试这些步骤,也可以在系统重启后再试。

    【讨论】:

    • 谢谢,我的电脑已经下载成功vue/cli
    猜你喜欢
    • 2021-02-13
    • 2021-08-25
    • 2019-12-17
    • 2020-11-01
    • 1970-01-01
    • 2017-11-21
    • 2018-05-08
    • 2017-11-09
    • 1970-01-01
    相关资源
    最近更新 更多