在Windows 10上安装ionic时出错

时间:2016-11-07 22:14:39

标签: node.js windows cordova ionic-framework

C:\Program Files>npm install -g ionic cordova
C:\Users\myname\AppData\Roaming\npm

` - ionic@2.1.4

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "ionic"    "cordova"
npm ERR! node v7.0.0
npm ERR! npm  v3.10.8
npm ERR! path C:\Users\myname\AppData\Roaming\npm\node_modules\.staging\abbrev-514e00ac
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename

npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\myname\AppData\Roaming\npm\node_modules\.staging\abbrev-514e00ac' ->     'C:\Users\myname\AppData\Roaming\npm\node_modules\cordova\node_modules\npm\node_modules\ab brev'
 npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\myname\AppData\Roaming\npm\node_modules\.staging\abbrev-514e00ac' ->  'C:\Users\myname\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! Windows_NT 10.0.14393
 npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "ionic" "cordova"
npm ERR! node v7.0.0
npm ERR! npm  v3.10.8
npm ERR! path C:\Program Files\npm-debug.log.3790864127
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall open

npm ERR! Error: EPERM: operation not permitted, open 'C:\Program Files\npm-debug.log.3790864127'
npm ERR!  { Error: EPERM: operation not permitted, open 'C:\Program Files\npm-debug.log.3790864127'
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'open',
npm ERR!   path: 'C:\\Program Files\\npm-debug.log.3790864127' }
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!     C:\Program Files\npm-debug.log

我一直在尝试在我的Windows笔记本电脑上安装离子。在我的笔记本电脑上安装离子之前,我安装了nodejs。但在那之后,每次我尝试安装离子时,它都会在我的命令提示符下显示此错误。我也在这个网站以及其他网站上寻找类似的问题,但是找不到任何可以解决我问题的问题。我还在窗口10上看了npm install -g cordova and ionic 2 error离子] [1] 但是那里提供的解决方案也不起作用。

3 个答案:

答案 0 :(得分:1)

请遵循以下步骤: -

1-首先检查您是否拥有最新的节点版本。 2-然后搜索命令提示符和 RUN IT AS ADMINISTRATOR。 3-然后键入以上命令: -

 npm install -g ionic 
    npm install -g cordova

答案 1 :(得分:0)

使用管理员权限打开nodejs命令提示符,重定向到c:>驱动器,然后尝试使用相同的命令。

  

npm install -g ionic cordova

如果您仍然收到错误,则可能是您的节点版本here is link to refer about this issue and answer from ionic team

出现问题

答案 2 :(得分:0)

我通过卸载我的nodejs然后安装新的nodejs v 5.11来解决这个问题