簡體   English   中英

由於代理設置,jspm install無法從npm和github下載軟件包

[英]jspm install can't download packages from npm and github due to proxy settings

我正在嘗試運行簡單的角度2單元測試應用程序。 我已經克隆了git並按照自述文件中的步驟進行了克隆。

https://github.com/matthewharwood/Hit-the-gym

我為npm設置了代理設置,為git禁用了strict-ssl設置。 我還為http_proxy和https_proxy導出了環境變量。

當我運行以下命令時

npm install

它將為“ jspm install”命令引發錯誤,如下所示:

    C:\angularjs20\unit-test1\Hit-the-gym>npm install
    npm WARN package.json @ No repository field.
    npm WARN optional dep failed, continuing fsevents@0.3.8
    |
    > phantomjs@1.9.18 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
    -
    > ws@0.4.32 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文件的內容:

        {
     "jspm": {
       "directories": {},
       "dependencies": {
         "jquery": "npm:jquery@^2.1.4"
       },
       "devDependencies": {
         "traceur": "github:jmcriffey/bower-traceur@0.0.89",
         "traceur-runtime": "github:jmcriffey/bower-traceur-runtime@0.0.89"
       }
     },
     "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"
     }

有人可以幫我解決這個問題嗎?

任何幫助非常感謝!

我也有npm問題,但是我不確定這是否是同樣的問題。 抱歉,如果沒有。

我通過在文件中添加“ strict-ssl = false”行來修復此問題:C:\\ Users {username} \\ npmrc(如果不存在則創建)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM