Angular快速入门 - npm安装问题

时间:2016-04-12 07:24:23

标签: angular npm npm-install

我正在关注getting started guide for Angular

到目前为止,我已经克隆了回购并且现在正在尝试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 lib相同。

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

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

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

但这没有任何区别,我正在运行节点v 4.4.1,以防相关。

在尝试安装此repo的依赖项时,是否有人遇到任何类似的问题?

1 个答案:

答案 0 :(得分: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