【问题标题】:npm install ghost fails with code EPERM errno -4048 syscall rename (on Windows)npm install ghost 失败,代码 EPERM errno -4048 syscall rename(在 Windows 上)
【发布时间】:2016-08-09 05:39:53
【问题描述】:

在使用 npm 版本 3.8.x 安装 Ghost 期间,出现以下错误:

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.8
npm WARN Gonzah@0.0.1 No repository field.
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\aosman\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "ghost"
npm ERR! node v4.3.2
npm ERR! npm  v3.8.1
npm ERR! path D:\elastc-app\node_modules\ghost
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename

npm ERR! Error: EPERM: operation not permitted, rename 'D:\elastc-app\node_modules\ghost' -> 'D:\elastc-app\node_modules\.ghost.DELETE'
npm ERR!     at moveAway (C:\Users\aosman\AppData\Roaming\npm\node_modules\npm\lib\install\action\finalize.js:38:5)
npm ERR!     at destStatted (C:\Users\aosman\AppData\Roaming\npm\node_modules\npm\lib\install\action\finalize.js:27:7)
npm ERR!     at FSReqWrap.oncomplete (fs.js:82:15)
npm ERR!
npm ERR! Error: EPERM: operation not permitted, rename 'D:\elastc-app\node_modules\ghost' -> 'D:\elastc-app\node_modules\.ghost.DELETE'
npm ERR!     at Error (native)
npm ERR!  { [Error: EPERM: operation not permitted, rename 'D:\elastc-app\node_modules\ghost' -> 'D:\elastc-app\node_modules\.ghost.DELETE'] parent: 'Gonzah' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     D:\elastc-app\npm-debug.log

在搜索了一天后发现它显然与 npm v3.8 (https://github.com/npm/npm/issues/10379#issuecomment-163316532) 中的一个已知错误有关。

【问题讨论】:

    标签: node.js windows npm ghost


    【解决方案1】:

    解决方案是暂时将 npm 降级到 v2 以执行安装。这样做:

    npm uninstall npm -g
    npm install npm@2 -g
    npm install ghost
    

    那么当然可以再次将 npm 更新到最新版本。

    【讨论】:

      猜你喜欢
      • 2019-07-07
      • 2021-06-28
      • 1970-01-01
      • 1970-01-01
      • 2015-03-30
      • 2020-08-27
      • 2022-01-06
      • 2018-02-15
      • 2014-03-20
      相关资源
      最近更新 更多