在cmd中安装离子时出错

使用cmd尝试安装离子时,我总是收到错误

在此之前我已经安装了Node JS

$ npm install -g cordova ionic npm ERR! code SELF_SIGNED_CERT_IN_CHAIN npm ERR! errno SELF_SIGNED_CERT_IN_CHAIN npm ERR! request to https://registry.npmjs.org/cordova failed, reason: self signed certificate in certificate chain npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\samar_000\AppData\Roaming\npm-cache\_logs\2017-07- 23T10_58_18_779Z-debug.log 

尝试这个

  npm set strict-ssl false 

或者你可以像这里build议的那样升级你的npm