cnpm配置


npm是外國的服務器,訪問下載有時會出現問題,可以連接中國本地的鏡像服務器
    https://npmmirror.com/

命令行中輸入安裝鏡像服務器
    npm install -g cnpm --registry=https://registry.npmmirror.com

用法和指令就是把npm 變成 cnpm
    cnpm i math --save
    cnpm -v

cnpm與npm安裝的包不一樣
項目中用到 vuedraggable 2.16.0版本,而 vuedraggable  依賴了 sortablejs 這個包,通過cnpm install安裝與npm install安裝的結果不一樣。
cpm安裝:sortablejs 為 1.10.2,打包完成后,不能使用
npm安裝:sortablejs 為 1.9.0, 打包完成后,可以使用


以后安裝包首先:

npm install

不行就用registry參數,就上面的包,與npm install的結果是一致的

npm install --registry=https://registry.npmmirror.com

最次,用
cnpm install


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM