【问题标题】:Still "Please try running this command again as root/Administrator."仍然“请尝试以 root/管理员身份再次运行此命令。”
【发布时间】:2018-05-18 17:05:29
【问题描述】:

Windows 10,Git Bash(作为管理员),尝试:npm install --save-dev webpack-stream 并得到了这个:

npm ERR! path D:\Projects\SomeProject\frontend\node_modules\fsevents\node_modules\getpass\node_modules
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall lstat
npm ERR! Error: EPERM: operation not permitted, lstat 'D:\Projects\SomeProject\frontend\node_modules\fsevents\node_modules\getpass\node_modules'
npm ERR!  { Error: EPERM: operation not permitted, lstat 'D:\Projects\SomeProject\frontend\node_modules\fsevents\node_modules\getpass\node_modules'
npm ERR!   stack: 'Error: EPERM: operation not permitted, lstat \'D:\\Projects\\SomeProject\\frontend\\node_modules\\fsevents\\node_modules\\getpass\\node_modules\'',
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'lstat',
npm ERR!   path: 'D:\\Projects\\SomeProject\\frontend\\node_modules\\fsevents\\node_modules\\getpass\\node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\User\AppData\Roaming\npm-cache\_logs\2017-12-05T05_24_31_143Z-debug.log

我正在尝试:

npm cache verify

和:

npm cache clean -f

没有结果。

尝试关闭防病毒软件 - 没有结果。尝试以管理员身份运行 cmd 然后:cd project-folder -> npm install --save-dev webpack-stream - 没有结果。

npm -v
5.5.1

node -v
v8.9.1

是否有可能解决我的问题?

【问题讨论】:

  • 您找到解决方案了吗?
  • 我没有,现在我安装这样的包:npm i packName*@*previous version --save。不是最佳解决方案,但它有效。

标签: node.js git npm webpack npm-install


【解决方案1】:

对我有用的是右键单击项目文件夹,选择“属性”,然后取消选择“只读”,然后取消选择“应用”。

【讨论】:

    【解决方案2】:

    试试这个

    npm config set unsafe-perm=true
    

    source

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-04-15
      • 1970-01-01
      • 2018-04-22
      • 2014-12-24
      • 2018-02-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多