使用npm安装报错Code128

Posted Adorable_Rocy

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了使用npm安装报错Code128相关的知识,希望对你有一定的参考价值。

报错详情如下:

npm ERR! code 128
npm ERR! Command failed: git clone --depth=1 -q -b fix/hr_is_inline git://github.com/sohee-lee7/Squire.git C:\\Program Files (x86)\\nodejs\\node_cache\\_cacache\\tmp\\git-clone-e7baf71d --config core.longpaths=true
npm ERR! warning: templates not found in C:\\Users\\ROOT\\AppData\\Local\\Temp\\pacote-git-template-tmp\\git-clone-c6189b7a
npm ERR! fatal: unable to access 'https://github.com/sohee-lee7/Squire.git/': OpenSSL SSL_read: Connection was reset, errno 10054

说白了就是windows不支持NODE_ENV=development的设置方式

  • 安装across-env:npm install cross-env --save-dev

  • 在NODE_ENV=xxxxxxx前面添加cross-env就可以了

set NODE_ENV=development && webpack --config webpack.config.dev.js

也是同样的效果,还有再补充一点,Node版本很重要,一定要选对版本,16+的版本很多问题会遇见,所以一定要选择合适自己的版本,不用直接冲对新版

以上是关于使用npm安装报错Code128的主要内容,如果未能解决你的问题,请参考以下文章