【问题标题】:Angular Quickstart - npm install issuesAngular 快速入门 - npm 安装问题
【发布时间】:2019-02-13 13:31:31
【问题描述】:

我正在关注getting started guide for Angular

到目前为止,我已经克隆了 repo,现在正在尝试npm install,但遇到了错误:

npm WARN package.json angular2-quickstart@1.0.0 No repository field.
npm ERR! registry error parsing json
npm ERR! fetch failed http://registry.npmjs.org/angular2/-/angular2-2.0.0-beta.1
4.tgz
npm WARN retry will retry, error on last attempt: Error: fetch failed with statu
s code 404
npm ERR! fetch failed http://registry.npmjs.org/systemjs/-/systemjs-0.19.25.tgz
npm WARN retry will retry, error on last attempt: Error: fetch failed with statu
s code 404
npm ERR! registry error parsing json
npm ERR! fetch failed http://registry.npmjs.org/lodash/-/lodash-4.10.0.tgz
npm WARN retry will retry, error on last attempt: Error: fetch failed with statu
s code 404
npm ERR! fetch failed http://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz
npm WARN retry will retry, error on last attempt: Error: fetch failed with statu
s code 404
npm ERR! registry error parsing json
npm ERR! fetch failed http://registry.npmjs.org/commander/-/commander-2.6.0.tgz
npm WARN retry will retry, error on last attempt: Error: fetch failed with statu
s code 404
npm ERR! registry error parsing json
npm ERR! fetch failed http://registry.npmjs.org/meow/-/meow-3.3.0.tgz
npm WARN retry will retry, error on last attempt: Error: fetch failed with statu
s code 404
npm ERR! registry error parsing json
npm WARN optional dep failed, continuing fsevents@1.0.11
npm ERR! registry error parsing json
npm ERR! fetch failed http://registry.npmjs.org/socket.io-adapter/-/socket.io-ad
apter-0.4.0.tgz
npm WARN retry will retry, error on last attempt: Error: fetch failed with statu
s code 404
npm ERR! registry error parsing json
-
> angular2-quickstart@1.0.0 postinstall C:\Users\rparker\Documents\GitHub\angula
r2-quickstart
> typings install

typings ERR! message Unable to read typings for "jasmine". You should check the
entry paths in "jasmine.d.ts" are up to date
typings ERR! caused by Unable to connect to "https://raw.githubusercontent.com/D
efinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/jasmine/
jasmine.d.ts"
typings ERR! caused by unable to get local issuer certificate

typings ERR! cwd C:\Users\rparker\Documents\GitHub\angular2-quickstart
typings ERR! system Windows_NT 6.1.7601
typings ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\rpa
rker\\Documents\\GitHub\\angular2-quickstart\\node_modules\\typings\\dist\\bin.j
s" "install"
typings ERR! node -v v4.4.1
typings ERR! typings -v 0.7.12

typings ERR! If you need help, you may report this error at:
typings ERR!   <https://github.com/typings/typings/issues>

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x8
6)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v4.4.1
npm ERR! npm  v2.14.20
npm ERR! code ELIFECYCLE
npm ERR! angular2-quickstart@1.0.0 postinstall: `typings install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular2-quickstart@1.0.0 postinstall script 'typings ins
tall'.
npm ERR! This is most likely a problem with the angular2-quickstart package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     typings install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs angular2-quickstart
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR!     npm owner ls angular2-quickstart
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\rparker\Documents\GitHub\angular2-quickstart\npm-debug.log

对于无法下载的资源,我只需在浏览器中打开 URL 即可获得这些资源。与给出 unable to get local issuer certificate 错误的 DefinitleyTyped 库相同。

所以我不确定下一步该做什么。

我已尝试将以下内容添加到我的 .npmrc 文件中:

ca=
strict-ssl=false
registry=http://registry.npmjs.org/

但这并没有什么不同,我正在运行 node v 4.4.1,以防万一。

在尝试安装此 repo 的依赖项时,有没有人遇到过类似的问题?

【问题讨论】:

  • 什么类型的系统,windows MAC?您是否支持代理?
  • 嗨@MarkPieszak - 我在Windows 7上,实际上我在公司环境中的代理后面。我遇到过有关如何使用 proxyhttps-proxy 选项将代理设置添加到 .npmrc 文件的帖子,我在从支持团队获取代理详细信息后尝试过,但我仍然没有进一步了解过去这些错误
  • 我认为您可能需要与 IT 交谈并告诉他们允许通过命令行访问 npm 和 GitHub 链接。我猜他们否认这一切:(

标签: angular npm npm-install


【解决方案1】:

你有正确的代理地址吗?

检查您的 npm 设置:

npm config list

您可能需要的一些示例:

npm config set registry http://registry.npmjs.org/
npm config set http-proxy http://username:password@ip:port
npm config set https-proxy http://username:password@ip:port
npm set strict-ssl false

它最近可能发生了变化,你需要尝试一下:http-proxy 可能是旧的

npm config set proxy http://proxy.address:proxy.port

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-12-08
  • 2016-07-28
  • 2018-04-03
  • 2018-09-18
  • 1970-01-01
  • 2016-04-11
相关资源
最近更新 更多