2016-09-19 155 views
-1

我试图安装离子2几个小时,但我没有成功。 而我用命令CMD安装科尔多瓦“故宫安装-g科尔多瓦” 我得到这个错误npm install -g cordova和ionic 2错误

npm ERR! Windows_NT 10.0.14393 
 
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Adir\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "cordova" 
 
npm ERR! node v4.5.0 
 
npm ERR! npm v3.10.7 
 
npm ERR! path C:\Users\Adir\AppData\Roaming\npm\node_modules\.staging\abbrev-ed18b12b 
 
npm ERR! code ENOENT 
 
npm ERR! errno -4058 
 
npm ERR! syscall rename 
 

 
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\Adir\AppData\Roaming\npm\node_modules\.staging\abbrev-ed18b12b' -> 'C:\Users\Adir\AppData\Roaming\npm\node_modules\cordova\node_modules\npm\node_modules\abbrev' 
 
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\Adir\AppData\Roaming\npm\node_modules\.staging\abbrev-ed18b12b' -> 'C:\Users\Adir\AppData\Roaming\npm\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: 
 
npm ERR!  C:\Users\Adir\npm-debug.log 
 
npm ERR! code 1

当我安装该命令“故宫安装-g离子离子“ 我得到这个错误

npm WARN In [email protected] replacing bundled version of semver with [email protected] 

NPM WARN在[email protected][email protected]更换离子-APP-lib中的捆绑版本npm ERR! Windows_NT 10.0.14393 npm ERR! argv“C:\ Program Files \ nodejs \ node.exe”“C:\ Users \ Adir \ AppData \ Roaming \ npm \ node_modules \ npm \ bin \ npm-cli.js”“install”“-g”“ionic” npm ERR!节点v4.5.0 npm ERR! npm v3.10.7 npm ERR!路径C:\ Users \ Adir \ AppData \ Roaming \ npm \ node_modules.staging \ ansi-75d35ef1 npm ERR!代码ENOENT npm ERR! errno -4058 npm ERR!系统调用重命名

npm ERR! enoent ENOENT:没有这样的文件或目录,重命名'C:\ Users \ Adir \ AppData \ Roaming \ npm \ node_modules.staging \ ansi-75d35ef1' - >'C:\ Users \ Adir \ AppData \ Roaming \ npm \ node_modules \ ionic \ node_modules \ cordova-lib \ node_modules \ ansi' npm ERR! enoent ENOENT:没有这样的文件或目录,重命名'C:\ Users \ Adir \ AppData \ Roaming \ npm \ node_modules.staging \ ansi-75d35ef1' - >'C:\ Users \ Adir \ AppData \ Roaming \ npm \ node_modules \ ionic \ node_modules \ cordova-lib \ node_modules \ ansi' npm ERR! enoent这很可能不是npm本身的问题 npm ERR!并且与npm无法找到文件有关。 npm ERR! enoent

npm ERR!请包括以下任何支持请求的文件: npm ERR! C:\ Users \ Adir \ npm-debug.log npm ERR!代码1

回答

1

校验和失败npm ERR! shasum检查失败

您可以尝试升级到故宫的最新版本:

npm install -g npm 

要升级到NPM 3。

另外:

npm cache clean 

enter code here 

NPM组注册表https://registry.npmjs.org/

2

什么固定我的问题是我试图unistalling并通过BREW在Mac
重新安装节点 npm cache clean
brew uninstall --force node
rm -r /usr/local/lib/node_modules
brew install node

现在,如果你运行 “的节点”
它应该在我的.bash_profile /usr/local/bin/node

现在设置NODE_PATH为
export NODE_PATH=/usr/local/lib/node_modules

这一点,给了我后不问题什么那么有

1
1 - Install the latest version of NodeJS from their website (e.g. 6.X.X). 
2 - Open the Node.js command prompt as administrator. 
3 - Run: npm cache clean 
4 - Run: npm uninstall -g ionic 
5 - Run: npm uninstall -g cordova 
6 - Run: npm install -g ionic 
7 - Run: npm install -g cordova 
1

好像你有一些版本不匹配的问题。所以下载最新的节点,安装最新的npm并重新启动。

npm install [email protected] -g 
npm cache clean 
npm unistall -g cordova 
npm intsall -g cordova