顯示具有 proxy 標籤的文章。 顯示所有文章
顯示具有 proxy 標籤的文章。 顯示所有文章

2016年8月24日 星期三

Nodejs npm install error

最近AngularJS2又更新了,連Type Script5 MIN QUICKSTART也更新,之前做過的Sample不知道丟哪去了。為了想重新看了一下裡面的差異,決定再做一次好了,沒想到nodejs此時的需求居然又變了,只好重新再下載一次。

以下是官網的需求說明
Install Node.js® and npm if they are not already on your machine.
Verify that you are running at least node v4.x.x and npm 3.x.x by running node -v and npm -vin a terminal/console window. Older versions produce errors.


因為在公司使用,所以必須修改proxy設定。

npm config set https-proxy http://proxyServer:80
npm config set proxy http://proxyServer:80

結果出現了一堆的Errororz

剛開始注意到的error codeUNABLE_TO_VERIFY_LEAF_SIGNATURE

error code UNABLE_TO_VERIFY_LEAF_SIGNATURE

查了半天只知道大概可能是網路問題,但Proxy Server已經定義好了,為什麼還是有這問題?
後來才又仔細看了一下npm-debug.log裡面,找到了unable to verify the first certificate

Error: unable to verify the first certificate

才找到可能的原因可能是因為http://registry.npmjs.org/沒有被proxy信任,參考

所以再執行以下指令才終於成功T_T

npm config set registry http://registry.npmjs.org/ --global

做個紀錄一下…..