由于代理服务器设置

由于代理服务器设置

本文介绍了JSPM安装无法下载从NPM和github上的包,由于代理服务器设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图运行简单的角度2单元测试应用程序。我已经克隆低于自述文件中给出的Git和随后的步骤。

I am trying to run simple angular 2 unit test application. I have cloned below git and following steps given in readme file.

我有NPM和残疾人严格的SSL设置git的设置代理设置。
我也有出口环境变量http_proxy和https_proxy。

I have setup proxy setting for npm and disabled strict-ssl setting for git.I have also exported environment variable for http_proxy and https_proxy.

当我运行下面的命令

npm install

它抛出错误如下JSPM安装命令:

it throws error for "jspm install" command as below:

    C:\angularjs20\unit-test1\Hit-the-gym>npm install
    npm WARN package.json @ No repository field.
    npm WARN optional dep failed, continuing [email protected]
    |
    > [email protected] install C:\angularjs20\unit-test1\Hit-the-gym\node_modules\p
    antomjs
    > node install.js

    Download already available at C:\Users\bchavan\AppData\Local\Temp\phantomjs\pha
    tomjs-1.9.8-windows.zip
    Extracting zip contents
    Removing C:\angularjs20\unit-test1\Hit-the-gym\node_modules\phantomjs\lib\phant
    m
    Copying extracted folder C:\Users\bchavan\AppData\Local\Temp\phantomjs\phantomj
    -1.9.8-windows.zip-extract-1440415812246\phantomjs-1.9.8-windows -> C:\angularj
    20\unit-test1\Hit-the-gym\node_modules\phantomjs\lib\phantom
    Writing location.js file
    Done. Phantomjs binary available at C:\angularjs20\unit-test1\Hit-the-gym\node_
    odules\phantomjs\lib\phantom\phantomjs.exe
    -
    > [email protected] install C:\angularjs20\unit-test1\Hit-the-gym\node_modules\karma\no
    e_modules\socket.io\node_modules\socket.io-client\node_modules\ws
    > (node-gyp rebuild 2> builderror.log) || (exit 0)


    C:\angularjs20\unit-test1\Hit-the-gym\node_modules\karma\node_modules\socket.io
    node_modules\socket.io-client\node_modules\ws>if not defined npm_config_node_gy
     (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_m
    dules\node-gyp\bin\node-gyp.js" rebuild )  else (rebuild)
    -
    > @ postinstall C:\angularjs20\unit-test1\Hit-the-gym
    > jspm install

         Looking up npm:jquery

    warn Error on lookup for npm:jquery, retrying (1).
         Error: unable to verify the first certificate
             at Error (native)
             at TLSSocket.<anonymous> (_tls_wrap.js:929:36)
             at TLSSocket.emit (events.js:104:17)
             at TLSSocket._finishInit (_tls_wrap.js:460:8)

    warn Error on lookup for npm:jquery, retrying (2).
         Error: unable to verify the first certificate
             at Error (native)
             at TLSSocket.<anonymous> (_tls_wrap.js:929:36)
             at TLSSocket.emit (events.js:104:17)
             at TLSSocket._finishInit (_tls_wrap.js:460:8)

    warn Error on lookup for npm:jquery, retrying (3).
         Error: unable to verify the first certificate
             at Error (native)
             at TLSSocket.<anonymous> (_tls_wrap.js:929:36)
             at TLSSocket.emit (events.js:104:17)
             at TLSSocket._finishInit (_tls_wrap.js:460:8)

    warn Error on lookup for npm:jquery
         Error: unable to verify the first certificate
             at Error (native)
             at TLSSocket.<anonymous> (_tls_wrap.js:929:36)
             at TLSSocket.emit (events.js:104:17)
             at TLSSocket._finishInit (_tls_wrap.js:460:8)

    err  Error looking up npm:jquery.

    warn Installation changes not saved.

    npm ERR! Windows_NT 6.1.7601
    npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodej
    \\node_modules\\npm\\bin\\npm-cli.js" "install"
    npm ERR! node v0.12.2
    npm ERR! npm  v2.7.4
    npm ERR! code ELIFECYCLE
    npm ERR! @ postinstall: `jspm install`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the @ postinstall script 'jspm install'.
    npm ERR! This is most likely a problem with the  package,
    npm ERR! not with npm itself.
    npm ERR! Tell the author that this fails on your system:
    npm ERR!     jspm install
    npm ERR! You can get their info via:
    npm ERR!     npm owner ls
    npm ERR! There is likely additional logging output above.

    npm ERR! Please include the following file with any support request:
    npm ERR!     C:\angularjs20\unit-test1\Hit-the-gym\npm-debug.log

下面是的package.json文件内容:

Below is the package.json file content:

        {
     "jspm": {
       "directories": {},
       "dependencies": {
         "jquery": "npm:jquery@^2.1.4"
       },
       "devDependencies": {
         "traceur": "github:jmcriffey/[email protected]",
         "traceur-runtime": "github:jmcriffey/[email protected]"
       }
     },
     "scripts": {
       "postinstall": "jspm install",
       "start": "live-server --open=client/index.html --port=9090 ./"
     },
     "devDependencies": {
       "jasmine-core": "^2.3.4",
       "jspm": "^0.15.6",
       "karma": "^0.12.35",
       "karma-chrome-launcher": "^0.1.12",
       "karma-coverage": "^0.3.1",
       "karma-jasmine": "^0.3.5",
       "karma-jspm": "^1.1.5",
       "karma-phantomjs-launcher": "^0.2.0",
       "phantomjs": "^1.9.17"
     }

有谁请帮我解决这个问题呢?

Could anybody please help me to solve this issue?

任何帮助非常AP preciated!

Any help very much appreciated!

推荐答案

我与故宫的问题太多,但我不知道这是否是同样的问题。很抱歉,如果没有。

I had problem with npm too, but I'm not sure if it was the same problem. Sorry if not.

我通过添加一行严格的SSL =假将文件固定它:
C:\\用户名{} \\ npmrc(如创建不存在)

I have fixed it by adding the line "strict-ssl=false" to the file:C:\Users{username}\npmrc (create if not exist)

这篇关于JSPM安装无法下载从NPM和github上的包,由于代理服务器设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 04:26