'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