npm install正在崩溃:
sudo npm install -g @ angular / cli
我尝试用现金清理几次卸载它,然后用@ angular / cli安装它,它总是崩溃。
dmitri@dmitri-thinkpad-e570:~$ sudo npm install -g @angular/cli
npm WARN registry Using stale data from https://registry.npmjs.org/ because the host is inaccessible -- are you offline?
npm WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.
npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging/bn.js-a9de3ac3/lib/bn.js'
npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging/zone.js-071eb577/dist/async-test.js'
npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging/webpack-dev-server-4b3dbb2d/bin/webpack-dev-server.js'
npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging/zone.js-071eb577/dist/webapis-media-query.min.js'
npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging/zone.js-071eb577/dist/webapis-notification.js'
npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging/zone.js-071eb577/dist/webapis-notification.min.js'
npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging/ajv-keywords-e7de9002/keywords/dotjs/README.md'
npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging/zone.js-071eb577/dist/webapis-rtc-peer-connection.js'
npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging/ajv-keywords-e7de9002/keywords/dotjs/_formatLimit.js'
npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging/zone.js-071eb577/dist/webapis-media-query.js'
npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging/ajv-keywords-e7de9002/keywords/dotjs/patternRequired.js'
npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging/zone.js-071eb577/dist/webapis-shadydom.js'
npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging//src/serializers/dts.js'
npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging/ajv-keywords-e7de9002/keywords/dotjs/switch.js'
npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging/zone.js-071eb577/dist/webapis-shadydom.min.js'
npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging//src/serializers/json.js'
npm WARN tar ENOENT: no such file or directory, lstat '/usr/local/lib/node_modules/.staging/ajv-keywords-e7de9002/keywords/dot'
npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging/zone.js-071eb577/dist/wtf.js'
npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging//src/serializers/dts.d.ts'
npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging/zone.js-071eb577/dist/wtf.min.js'
npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging//src/serializers/dts.js.map'
npm WARN tar ENOENT: no such file or directory, lstat '/usr/local/lib/node_modules/.staging/ajv-keywords-e7de9002/keywords/dot'
npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging/zone.js-071eb577/dist/zone-bluebird.js'
npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging//src/serializers/json.d.ts'
npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging/zone.js-071eb577/dist/task-tracking.min.js'
npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging//src/serializers/json.js.map'
npm WARN tar ENOENT: no such file or directory, lstat '/usr/local/lib/node_modules/.staging/ajv-keywords-e7de9002/keywords/dot'
npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging/zone.js-071eb577/dist/zone-bluebird.min.js'
npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging/zone.js-071eb577/dist/task-tracking.js'
npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging/zone.js-071eb577/dist/zone-error.js'
npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging/zone.js-071eb577/dist/sync-test.js'
npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging/bluebird-57ade097/js/browser/bluebird.min.js'
npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging/zone.js-071eb577/dist/zone-error.min.js'
npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging/zone.js-071eb577/dist/proxy.min.js'
npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging/zone.js-071eb577/dist/zone-mix.js'
npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging/caniuse-db-e3ba940e/.editorconfig'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.5.3 (node_modules//node_modules/node-sass):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: Cannot cd into '/usr/local/lib/node_modules/.staging/node-sass-d131eca4'
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npmjs.org/url-loader/-/url-loader-0.6.2.tgz failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in:
npm ERR! /home/dmitri/.npm/_logs/2017-10-30T12_53_53_219Z-debug.log
supporting information:
答案 0 :(得分:0)
完全删除 node_modules 目录,然后再次运行sudo npm install
如果需要,你可以试试这个:
要在本地运行npm install @angular/cli --save
安装 @ angular / cli ,要在全球范围内安装npm install -g @angular/cli
。
但如果它需要root访问权限,那么您必须包含sudo
,然后sudo npm install -g @angular/cli
。
或视具体情况检查您的网络连接(Internet)。
我希望这会有所帮助