我在安装 angular 时遇到问题
I am having a trouble in installing angular
我在安装 angular 时遇到此错误。我想可能是 npm 路径的问题,但是如何解决呢。
我做了 root 权限然后也得到了认证不受信任的错误。错误低于 -
root@Aishwarya:/# npm uninstall -g angular-cli
npm WARN uninstall not installed in /usr/local/lib/node_modules: "angular-cli"
root@Aishwarya:/# npm install -g angular-cli
npm http GET https://registry.npmjs.org/angular-cli
npm http GET https://registry.npmjs.org/angular-cli
npm http GET https://registry.npmjs.org/angular-cli
npm ERR! Error: CERT_UNTRUSTED
npm ERR! at SecurePair.<anonymous> (tls.js:1370:32)
npm ERR! at SecurePair.EventEmitter.emit (events.js:92:17)
npm ERR! at SecurePair.maybeInitFinished (tls.js:982:10)
npm ERR! at CleartextStream.read [as _read] (tls.js:469:13)
npm ERR! at CleartextStream.Readable.read (_stream_readable.js:320:10)
npm ERR! at EncryptedStream.write [as _write] (tls.js:366:25)
npm ERR! at doWrite (_stream_writable.js:223:10)
npm ERR! at writeOrBuffer (_stream_writable.js:213:5)
npm ERR! at EncryptedStream.Writable.write (_stream_writable.js:180:11)
npm ERR! at write (_stream_readable.js:583:24)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-@googlegroups.com>
npm ERR! System Linux 4.2.0-35-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "angular-cli"
npm ERR! cwd /
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /npm-debug.log
npm ERR! not ok code 0
root@Aishwarya:/#
我认为这是网络问题,如果您使用 Linux 那么;
sudo service network-manager restart
如果 windows 那么重启电脑应该可以解决这个问题。
也可能是 git 版本问题或节点版本问题,如果那是问题的话:
- 卸载 Git、Node.js、npm
- 安装Git
- 使用 npm
安装 Node.js
- 安装angular
或者简单地执行以下操作也可以解决问题:
npm uninstall -g angular-cli
npm cache clean
npm install -g rxjs
npm install -g @angular/cli
我在安装 angular 时遇到此错误。我想可能是 npm 路径的问题,但是如何解决呢。 我做了 root 权限然后也得到了认证不受信任的错误。错误低于 -
root@Aishwarya:/# npm uninstall -g angular-cli
npm WARN uninstall not installed in /usr/local/lib/node_modules: "angular-cli"
root@Aishwarya:/# npm install -g angular-cli
npm http GET https://registry.npmjs.org/angular-cli
npm http GET https://registry.npmjs.org/angular-cli
npm http GET https://registry.npmjs.org/angular-cli
npm ERR! Error: CERT_UNTRUSTED
npm ERR! at SecurePair.<anonymous> (tls.js:1370:32)
npm ERR! at SecurePair.EventEmitter.emit (events.js:92:17)
npm ERR! at SecurePair.maybeInitFinished (tls.js:982:10)
npm ERR! at CleartextStream.read [as _read] (tls.js:469:13)
npm ERR! at CleartextStream.Readable.read (_stream_readable.js:320:10)
npm ERR! at EncryptedStream.write [as _write] (tls.js:366:25)
npm ERR! at doWrite (_stream_writable.js:223:10)
npm ERR! at writeOrBuffer (_stream_writable.js:213:5)
npm ERR! at EncryptedStream.Writable.write (_stream_writable.js:180:11)
npm ERR! at write (_stream_readable.js:583:24)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-@googlegroups.com>
npm ERR! System Linux 4.2.0-35-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "angular-cli"
npm ERR! cwd /
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /npm-debug.log
npm ERR! not ok code 0
root@Aishwarya:/#
我认为这是网络问题,如果您使用 Linux 那么;
sudo service network-manager restart
如果 windows 那么重启电脑应该可以解决这个问题。
也可能是 git 版本问题或节点版本问题,如果那是问题的话:
- 卸载 Git、Node.js、npm
- 安装Git
- 使用 npm 安装 Node.js
- 安装angular
或者简单地执行以下操作也可以解决问题:
npm uninstall -g angular-cli
npm cache clean
npm install -g rxjs
npm install -g @angular/cli