【问题标题】:Error when installing ionic with npm install -g ionic cordova on windows 10在 Windows 10 上使用 npm install -g ionic cordova 安装 ionic 时出错
【发布时间】:2016-11-19 04:05:25
【问题描述】:

我正在尝试安装 ionic 并返回此错误:

95376 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.0.15 (node_modules\ionic\node_modules\ionic-app-lib\node_modules\glob-watcher\node_modules\chokidar\node_modules\fsevents):
95377 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.0.15: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
95378 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS:    darwin
95378 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch:  any
95378 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS:   win32
95378 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
95379 verbose stack Error: ENOENT: no such file or directory, rename 'C:\Users\<username>\AppData\Roaming\npm\node_modules\.staging\abbrev-afcbf2ea' -> 'C:\Users\<username>\AppData\Roaming\npm\node_modules\cordova\node_modules\npm\node_modules\abbrev'
95379 verbose stack     at destStatted (C:\Users\<username>\AppData\Roaming\npm\node_modules\npm\lib\install\action\finalize.js:25:7)
95379 verbose stack     at C:\Users\<username>\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:264:29
95379 verbose stack     at FSReqWrap.oncomplete (fs.js:123:15)
95379 verbose stack
95379 verbose stack Error: ENOENT: no such file or directory, rename 'C:\Users\<username>\AppData\Roaming\npm\node_modules\.staging\abbrev-afcbf2ea' -> 'C:\Users\<username>\AppData\Roaming\npm\node_modules\cordova\node_modules\npm\node_modules\abbrev'
95379 verbose stack     at Error (native)
95380 verbose cwd C:\Users\<username>\Documents\sc-ionic
95381 error Windows_NT 10.0.14393
95382 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\<username>\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "ionic" "cordova"
95383 error node v6.9.1
95384 error npm  v3.10.9
95385 error path C:\Users\<username>\AppData\Roaming\npm\node_modules\.staging\abbrev-afcbf2ea
95386 error code ENOENT
95387 error errno -4058
95388 error syscall rename
95389 error enoent ENOENT: no such file or directory, rename 'C:\Users\<username>\AppData\Roaming\npm\node_modules\.staging\abbrev-afcbf2ea' -> 'C:\Users\<username>\AppData\Roaming\npm\node_modules\cordova\node_modules\npm\node_modules\abbrev'
95390 error enoent ENOENT: no such file or directory, rename 'C:\Users\<username>\AppData\Roaming\npm\node_modules\.staging\abbrev-afcbf2ea' -> 'C:\Users\<username>\AppData\Roaming\npm\node_modules\cordova\node_modules\npm\node_modules\abbrev'
95390 error enoent This is most likely not a problem with npm itself
95390 error enoent and is related to npm not being able to find a file.
95391 verbose exit [ -4058, true ]

它试图在 npm 模块中重命名一些不存在的目录“abbrev-afcbf2ea”。

【问题讨论】:

  • 通过npm cache clean 尝试并重新安装它们。我确实在 Windows 10 上安装了它,2 小时前它工作了
  • 尝试npm install abbrev 然后尝试安装ionic
  • 这两种解决方案都不起作用! :/ 我只安装了 ionic 并且在我的应用程序上运行良好的“ionic serve”,但是当我安装“cordova”时仍然返回这个错误。

标签: node.js cordova ionic-framework npm


【解决方案1】:

我已经解决了删除 node_modules 文件夹并运行:

npm install -g --save ionic cordova

我认为这是一个缓存问题,因为 ionic + cordova 的依赖项安装出现问题导致 node_modules 路径崩溃!

【讨论】:

    猜你喜欢
    • 2018-10-29
    • 2017-02-18
    • 2017-03-20
    • 1970-01-01
    • 2015-08-05
    • 1970-01-01
    • 1970-01-01
    • 2018-06-14
    • 2017-03-21
    相关资源
    最近更新 更多