ionic2 cordova安装错误 - ENOENT [英] ionic2 cordova installation error - ENOENT

查看:753
本文介绍了ionic2 cordova安装错误 - ENOENT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在测试ionic2和已安装的节点,npm和cordova,它一直工作正常。但是,我更新npm后无法安装任何npm包。所以我删除所有的节点和npm相关的目录根据如何完全卸载Node.js,并从头开始重新安装(Mac OS X)并重新安装node-v6.9.1。但是这一次,当我试图安装cordova使用'sudo npm install -g ionic cordova',它给我一个错误:

I'm testing ionic2 and installed node, npm and cordova and it's been working fine. However, I couldn't install any npm package after I updated npm. So I removed all the node and npm related directories according to How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X) and reinstalled node-v6.9.1. But this time again, when I tried to install cordova using 'sudo npm install -g ionic cordova', it gives me an error:

$ rm -rf ~/.npm
$ npm cache clear
$ sudo npm install -g ionic cordova
npm WARN deprecated node-uuid@1.4.7: use uuid module instead
/usr/local/lib
└── ionic@2.1.12 

npm ERR! Darwin 16.1.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "ionic" "cordova"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8
npm ERR! path /usr/local/lib/node_modules/.staging/abbrev-ef9cc920
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename

npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/.staging/abbrev-ef9cc920' -> '/usr/local/lib/node_modules/cordova/node_modules/npm/node_modules/abbrev'
npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/.staging/abbrev-ef9cc920' -> '/usr/local/lib/node_modules/cordova/node_modules/npm/node_modules/abbrev'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! Please include the following file with any support request:

我一直在搜索谷歌和其他问题Stackoverflow但还是不能解决问题。我使用macOS Seira 10.12.1。

I've been searching Google and other question on Stackoverflow but could not solve the problem yet. I'm using macOS Seira 10.12.1.

这是一个npm错误还是我的错?是否有可能的解决方案来解决这个问题?

Is this a npm bug or my fault? Is there any possible solution to fix this issue?

感谢您的帮助。

推荐答案

此堆栈溢出帖子具有相同的问题。将Node.js版本降级到6.9.1解决了问题。

This stackoverflow post is with the same issue. Downgrade the Node.js version to 6.9.1 fixed the problem.

这篇关于ionic2 cordova安装错误 - ENOENT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆