【问题标题】:Encountering an error during npm install with angular 2 quickstart project在使用 Angular 2 快速入门项目进行 npm 安装期间遇到错误
【发布时间】:2016-07-28 01:38:40
【问题描述】:

我在尝试安装此 repo 的依赖项时遇到问题。

在安装后脚本中尝试typings install 命令时发生这种情况

我看到的输出是:

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

typings ERR! cwd C:\Users\rparker\Documents\GitHub\angular2-seed
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-seed\\node_modules\\typings\\dist\\bin.js" "in
stall"
typings ERR! node -v v4.4.1
typings ERR! typings -v 0.7.12

现在我在代理后面,所以我认为这一定是由于某种原因资源被阻止的问题。

我实际上可以在浏览器中导航到上述错误中引用的 url,并且 github 页面打开得很好。

在网上挖掘我发现了一些帖子,其中包含有关如何将代理设置添加到 npm 配置文件的说明。我知道代理的详细信息,所以我现在有:

ca=
strict-ssl=false
registry=http://registry.npmjs.org/
proxy=http://myusername:mypassword@proxydomain:proxyport
https-proxy=http://myusername:mypassword@proxydomain:proxyport

这对我没有任何影响,所以我不确定下一步该做什么。

谁能给点建议?

谢谢

【问题讨论】:

    标签: angularjs npm angular npm-install


    【解决方案1】:

    您还应该创建一个包含以下内容的.typingsrc 文件:

    proxy=http://myusername:mypassword@proxydomain:proxyport
    
    rejectUnauthorized=false
    

    【讨论】:

    • 谢谢!与我的 .npmrc 放在同一个文件夹中并发挥了作用
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-03-15
    • 1970-01-01
    • 1970-01-01
    • 2016-04-11
    • 1970-01-01
    • 2018-01-24
    • 1970-01-01
    相关资源
    最近更新 更多