npm 安裝cnpm淘寶鏡像時報錯解決


詳細報錯

D:\workspace\es61> npm install -g cnpm --registry=https://registry.npm.taobao.org
npm WARN deprecated socks@1.1.10: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0
npm WARN tar ENOENT: no such file or directory, lstat 'C:\Users\Administrator\AppData\Roaming\npm\node_modules\.staging\npm-bb88aed9\node_modules\read-installed\test'
npm ERR! path C:\Users\Administrator\AppData\Roaming\npm\node_modules\.staging\npm-bb88aed9\node_modules\abbrev
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\Administrator\AppData\Roaming\npm\node_modules\.staging\npm-bb88aed9\node_modules\abbrev' -> 'C:\Users\Administrator\AppData\Roaming\npm\node_modules\.staging\abbrev-99695b0f'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2019-02-24T14_16_24_548Z-debug.log
PS D:\workspace\es61> npm install -g cnpm --registry=https://registry.npm.taobao.org^C^C^C^C^C^C^C^C^C^C
npm ERR! Request path contains unescaped characters

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2019-02-24T14_18_17_575Z-debug.log
PS D:\workspace\es61> npm install -g cnpm@5.51 --registry=https://registry.npm.taobao.org
npm ERR! code ETARGET
npm ERR! notarget No matching version found for cnpm@5.51
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2019-02-24T14_21_13_999Z-debug.log
PS D:\workspace\es61> npm install -g cnpm@5.5.1 --registry=https://registry.npm.taobao.org
npm ERR! code ETARGET
npm ERR! notarget No matching version found for cnpm@5.5.1
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2019-02-24T14_21_24_209Z-debug.log

  解決

是因為cnpm 的安裝版本需要 npm版本支持   

1 cnpm -v 找到cnpm版本號

 

cnpm -v
cnpm@6.0.0 (C:\Users\Administrator\AppData\Roaming\npm\node_modules\cnpm\lib\parse_argv.js)
npm@6.8.0 (C:\Users\Administrator\AppData\Roaming\npm\node_modules\cnpm\node_modules\npm\lib\npm.js)
node@8.9.3 (D:\Program Files\tool\nodejs\node.exe)
npminstall@3.20.2 (C:\Users\Administrator\AppData\Roaming\npm\node_modules\cnpm\node_modules\npminstall\lib\index.js)
prefix=C:\Users\Administrator\AppData\Roaming\npm
win32 x64 10.0.14393
registry=https://registry.npm.taobao.org

 

2 使用命令安裝npm

npm install npm@6.0.0

3 再次執行安裝命令

npm install -g cnpm --registry=https://registry.npm.taobao.org

4 成功

 


免責聲明!

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



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