Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js npm在Ubuntu 16.04 LTS上安装angular cli时出现502错误_Node.js_Npm_Angular Cli_Npm Install - Fatal编程技术网

Node.js npm在Ubuntu 16.04 LTS上安装angular cli时出现502错误

Node.js npm在Ubuntu 16.04 LTS上安装angular cli时出现502错误,node.js,npm,angular-cli,npm-install,Node.js,Npm,Angular Cli,Npm Install,我正在尝试使用npm安装最新的angular cli: sudo -s npm install --save-dev @angular/cli@latest 但我总是得到502个错误: npm WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation. npm WARN enoent ENOENT: no such file

我正在尝试使用npm安装最新的angular cli:

sudo -s npm install --save-dev @angular/cli@latest
但我总是得到502个错误:

npm WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.
npm WARN enoent ENOENT: no such file or directory, open '/home/smilhais/package.json'
npm WARN smilhais No description
npm WARN smilhais No repository field.
npm WARN smilhais No README data
npm WARN smilhais No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: lodash.assign@4.2.0 (node_modules/lodash.assign):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 502 Connection timed out: lodash.assign@https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: loader-runner@2.3.0 (node_modules/loader-runner):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 502 Connection timed out: loader-runner@https://registry.npmjs.org/loader-runner/-/loader-runner-2.3.0.tgz
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: clone@2.1.1 (node_modules/less-loader/node_modules/clone):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 502 Connection timed out: clone@https://registry.npmjs.org/clone/-/clone-2.1.1.tgz
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: lazy-cache@0.2.7 (node_modules/lazy-cache):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 502 Connection timed out: lazy-cache@https://registry.npmjs.org/lazy-cache/-/lazy-cache-0.2.7.tgz
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: har-validator@4.2.1 (node_modules/har-validator):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 502 Connection timed out: har-validator@https://registry.npmjs.org/har-validator/-/har-validator-4.2.1.tgz
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: jsonify@0.0.0 (node_modules/jsonify):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 502 Connection timed out: jsonify@https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: is-number@2.1.0 (node_modules/is-number):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 502 Connection timed out: is-number@https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz

npm ERR! code E502
npm ERR! 502 Connection timed out: lodash.clonedeep@https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz
有人知道我为什么会得到这个吗?如何修复它

版本: 节点v8.0.0--NPM5.0.3--npm注册表


Linux:Ubuntu 16.04 LTS

npm WARN enoint enoint:没有这样的文件或目录,打开“/home/smilhais/package.json”
-您在安装npm之前是否进行了npm初始化?谢谢您的回复@KonstantinA.Magg。在安装npm之前,我没有执行npm init。我的问题是我有一个代理人。我禁用了它,它工作得很好。
npm WARN enoint enoint:没有这样的文件或目录,打开“/home/smilhais/package.json”
-您在安装npm之前做过npm init吗?谢谢您的回复@KonstantinA.Magg。在安装npm之前,我没有执行npm init。我的问题是我有一个代理人。我禁用了它,它工作得很好。