ng new 无法解压缓存
ng new does fail to untar cache
我尝试使用 angular-cli 创建一个新的 Angular2 应用程序,但无法使其正常工作。
ng new 在 npm 步骤中失败:Installing packages for tooling via npm
Installing packages for tooling via npm
typings ERR! message Unable to connect to "https://api.typings.org/entries/dt/es6-shim/tags/0.31.2%2B20160317120654"
typings ERR! caused by getaddrinfo ENOTFOUND company company:443
typings ERR! cwd D:\Source\testsdfsa
typings ERR! system Windows_NT 6.3.9600
typings ERR! command "C:\Program Files\nodejs\node.exe" "D:\Source\testsdfsa\node_modules\typings\dist\bin.js" "install"
typings ERR! node -v v4.4.7
typings ERR! typings -v 0.8.1
typings ERR! code EUNAVAILABLE
如果我之后尝试 运行 npm install,我会得到同样的错误。重新启动,从头开始并清除缓存并没有改变任何东西。
如果我在第一次失败后尝试再次安装而不清除缓存,我会收到以下错误:
untar error C:\Users\user\AppData\Local\Temp\npm-2280-3cd29f2f\
registry.npmjs.org\source-map\-\source-map-0.5.6.tgz
untar error C:\Users\user\AppData\Local\Temp\npm-2280-3cd29f2f\
registry.npmjs.org\source-map\-\source-map-0.5.6.tgz
untar error C:\Users\user\AppData\Local\Temp\npm-2280-3cd29f2f\
registry.npmjs.org\bluebird\-\bluebird-3.4.1.tgz
unexpected eof
Error: unexpected eof
at decorate (C:\Users\schnaitlr\AppData\Roaming\npm\node_modules\angular-cli\node_modules\npm\node_modules\fstream\lib\abstract.js:67:36)
at Extract.Abstract.error (C:\Users\schnaitlr\AppData\Roaming\npm\node_modules\angular-cli\node_modules\npm\node_modules\fstream\lib\abstract.js:61:12)
at Extract._streamEnd (C:\Users\schnaitlr\AppData\Roaming\npm\node_modules\angular-cli\node_modules\npm\node_modules\tar\lib\extract.js:91:35)
at BlockStream.<anonymous> (C:\Users\schnaitlr\AppData\Roaming\npm\node_modules\angular-cli\node_modules\npm\node_modules\tar\lib\parse.js:51:8)
at emitNone (events.js:67:13)
at BlockStream.emit (events.js:166:7)
at BlockStream._emitChunk (C:\Users\schnaitlr\AppData\Roaming\npm\node_modules\angular-cli\node_modules\npm\node_modules\tar\node_modules\block-stream\block-stream.js:203:10)
at BlockStream.flush (C:\Users\schnaitlr\AppData\Roaming\npm\node_modules\angular-cli\node_modules\npm\node_modules\tar\node_modules\block-stream\block-stream.js:70:8)
at BlockStream.end (C:\Users\schnaitlr\AppData\Roaming\npm\node_modules\angular-cli\node_modules\npm\node_modules\tar\node_modules\block-stream\block-stream.js:66:8)
at Extract.Parse.end (C:\Users\schnaitlr\AppData\Roaming\npm\node_modules\angular-cli\node_modules\npm\node_modules\tar\lib\parse.js:86:23)
我找出了导致问题的原因:
我使用
在 .typingsrc 文件中配置了我们的代理
HTTP://DOMAIN\user:pass@url:port
但是像 npm 这样的输入确实用正斜杠替换了反斜杠。这使得我们的代理无法通过身份验证。对反斜杠进行编码修复了问题
HTTP://DOMAIN%5Cuser:pass@url:port
我尝试使用 angular-cli 创建一个新的 Angular2 应用程序,但无法使其正常工作。
ng new 在 npm 步骤中失败:Installing packages for tooling via npm
Installing packages for tooling via npm
typings ERR! message Unable to connect to "https://api.typings.org/entries/dt/es6-shim/tags/0.31.2%2B20160317120654"
typings ERR! caused by getaddrinfo ENOTFOUND company company:443
typings ERR! cwd D:\Source\testsdfsa
typings ERR! system Windows_NT 6.3.9600
typings ERR! command "C:\Program Files\nodejs\node.exe" "D:\Source\testsdfsa\node_modules\typings\dist\bin.js" "install"
typings ERR! node -v v4.4.7
typings ERR! typings -v 0.8.1
typings ERR! code EUNAVAILABLE
如果我之后尝试 运行 npm install,我会得到同样的错误。重新启动,从头开始并清除缓存并没有改变任何东西。
如果我在第一次失败后尝试再次安装而不清除缓存,我会收到以下错误:
untar error C:\Users\user\AppData\Local\Temp\npm-2280-3cd29f2f\
registry.npmjs.org\source-map\-\source-map-0.5.6.tgz
untar error C:\Users\user\AppData\Local\Temp\npm-2280-3cd29f2f\
registry.npmjs.org\source-map\-\source-map-0.5.6.tgz
untar error C:\Users\user\AppData\Local\Temp\npm-2280-3cd29f2f\
registry.npmjs.org\bluebird\-\bluebird-3.4.1.tgz
unexpected eof
Error: unexpected eof
at decorate (C:\Users\schnaitlr\AppData\Roaming\npm\node_modules\angular-cli\node_modules\npm\node_modules\fstream\lib\abstract.js:67:36)
at Extract.Abstract.error (C:\Users\schnaitlr\AppData\Roaming\npm\node_modules\angular-cli\node_modules\npm\node_modules\fstream\lib\abstract.js:61:12)
at Extract._streamEnd (C:\Users\schnaitlr\AppData\Roaming\npm\node_modules\angular-cli\node_modules\npm\node_modules\tar\lib\extract.js:91:35)
at BlockStream.<anonymous> (C:\Users\schnaitlr\AppData\Roaming\npm\node_modules\angular-cli\node_modules\npm\node_modules\tar\lib\parse.js:51:8)
at emitNone (events.js:67:13)
at BlockStream.emit (events.js:166:7)
at BlockStream._emitChunk (C:\Users\schnaitlr\AppData\Roaming\npm\node_modules\angular-cli\node_modules\npm\node_modules\tar\node_modules\block-stream\block-stream.js:203:10)
at BlockStream.flush (C:\Users\schnaitlr\AppData\Roaming\npm\node_modules\angular-cli\node_modules\npm\node_modules\tar\node_modules\block-stream\block-stream.js:70:8)
at BlockStream.end (C:\Users\schnaitlr\AppData\Roaming\npm\node_modules\angular-cli\node_modules\npm\node_modules\tar\node_modules\block-stream\block-stream.js:66:8)
at Extract.Parse.end (C:\Users\schnaitlr\AppData\Roaming\npm\node_modules\angular-cli\node_modules\npm\node_modules\tar\lib\parse.js:86:23)
我找出了导致问题的原因: 我使用
在 .typingsrc 文件中配置了我们的代理HTTP://DOMAIN\user:pass@url:port
但是像 npm 这样的输入确实用正斜杠替换了反斜杠。这使得我们的代理无法通过身份验证。对反斜杠进行编码修复了问题
HTTP://DOMAIN%5Cuser:pass@url:port