'cnpm' is not recognized as an internal or external command


'cnpm' is not recognized as an internal or external command

切換administrator賬號cnpm不識別

解決:

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

卸載nodejs,重新安裝

注:@nuxt.js/cli找不到,刪除node_modules重新cnpm i

 

錯誤提示

npm install -g cnpm --registry=https://registry.npm.taobao.org
npm ERR! code SELF_SIGNED_CERT_IN_CHAIN
npm ERR! errno SELF_SIGNED_CERT_IN_CHAIN
npm ERR! request to https://registry.npm.taobao.org/cnpm failed, reason: self signed certificate in certificate chain

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\clu\AppData\Roaming\npm-cache\_logs\2020-12-23T05_28_08_155Z-debug.log

 

安裝成功

npm install -g cnpm --registry=https://registry.npm.taobao.org
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
C:\Users\clu\AppData\Roaming\npm\cnpm -> C:\Users\clu\AppData\Roaming\npm\node_modules\cnpm\bin\cnpm
+ cnpm@6.1.1
added 689 packages from 972 contributors in 1368.413s

 

查看cnpm對應的registry

 cnpm config get registry

https://registry.nlark.com/

 

'npm' is not recognized as internal or external command, operable program or batch file

Just add:

;C:\Program Files\nodejs\

To the end of your Path variable on the "User variable" section of the Environment Variables on the System Properties.

After that, reopen your command prompt and type

npm

This should work.

使用這個的前提是,先去官方下載安裝包。

https://nodejs.org/en/download/

node-v14.17.5-x64.msi 安裝之后,對應的路徑下,就會有了

 

>npm  version
{
  npm: '6.14.14',
  ares: '1.17.2',
  brotli: '1.0.9',
  cldr: '39.0',
  icu: '69.1',
  llhttp: '2.1.3',
  modules: '83',
  napi: '8',
  nghttp2: '1.42.0',
  node: '14.17.5',
  openssl: '1.1.1k',
  tz: '2021a',
  unicode: '13.0',
  uv: '1.41.0',
  v8: '8.4.371.23-node.76',
  zlib: '1.2.11'
}


免責聲明!

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



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