http://blog.csdn.net/jiangtongcn/article/details/46863743
在mac上構(gòu)建cordova開(kāi)發(fā)環(huán)境時(shí):
sudo npm install -g cordova,出現(xiàn)如下錯(cuò)誤:
npm ERR! Darwin 14.0.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "cordova"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! shasum check failed for /tmp/npm-971-2c493ef3/registry.npmjs.org/cordova-app-hello-world/-/cordova-app-hello-world-3.9.0.tgz
npm ERR! Expected: 5866d8fed5582686c68ec59a6d1097c4ec0fcc4b
npm ERR! Actual: 64cde365d38ba8c33b0d854af07c738bbd86488d
npm ERR! From: https://registry.npmjs.org/cordova-app-hello-world/-/cordova-app-hello-world-3.9.0.tgz
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /Users/sunchongguo/npm-debug.log
提示叫校驗(yàn)碼不正確妓蛮,處理辦法如下(我使用的第一種)
以下轉(zhuǎn)自他人博客,我采用的第一種
npm 使用國(guó)內(nèi)鏡像的方法
[圖片上傳中榄檬。卫旱。幽崩。(1)]轉(zhuǎn)載▼
鏡像使用方法(三種辦法任意一種都能解決問(wèn)題,建議使用第三種,將配置寫死,下次用的時(shí)候配置還在):
1.通過(guò)config命令
npm config set registry http://registry.cnpmjs.org npm info underscore (如果上面配置正確這個(gè)命令會(huì)有字符串response)
2.命令行指定
npm --registry http://registry.cnpmjs.org info underscore
3.編輯 ~/.npmrc
加入下面內(nèi)容
registry = http://registry.cnpmjs.org 4徒扶、修改全局模塊安裝目錄
npm config set prefix "D:\node\node-global" npm config set cache "D:\node\node-cache"