【Vue】NPM构建的一些问题解决

 

9418端口已经不再支持未授权的GIT协议

C:\Users\Administrator\Desktop\wss-taskcore-web>npm install
npm ERR! Error while executing:
npm ERR! C:\Program Files\Git\cmd\git.EXE ls-remote -h -t git://github.com/adobe-webplatform/eve.git
npm ERR!
npm ERR! fatal: remote error:
npm ERR!   The unauthenticated git protocol on port 9418 is no longer supported.
npm ERR! Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.
npm ERR!
npm ERR! exited with error code: 128

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2022-03-22T09_19_07_660Z-debug.log

C:\Users\Administrator\Desktop\wss-taskcore-web>

 

在.gitconfig文件中 C:\Users\Administrator\.gitconfig 更改协议配置:

[url "https://"]
	insteadOf = ssh://
[url "https://"]
	insteadOf = git://

 

无法访问此仓库:

C:\Users\Administrator\Desktop\wss-taskcore-web>npm install
npm ERR! Error while executing:
npm ERR! C:\Program Files\Git\cmd\git.EXE ls-remote -h -t https://github.com/nhn/raphael.git
npm ERR!
npm ERR! fatal: unable to access 'https://github.com/nhn/raphael.git/': OpenSSL SSL_read: Connection was reset, errno 10054
npm ERR!
npm ERR! exited with error code: 128

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2022-03-22T09_22_58_762Z-debug.log

C:\Users\Administrator\Desktop\wss-taskcore-web>

或者是这个仓库:

C:\Users\Administrator\Desktop\wss-taskcore-web>npm install
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm ERR! code 128
npm ERR! Command failed: git clone --mirror -q git://github.com/adobe-webplatform/eve.git C:\Users\Administrator\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-9bf47203\.git --config core.longpaths=true
npm ERR! warning: templates not found in C:\Users\ADMINI~1\AppData\Local\Temp\pacote-git-template-tmp\git-clone-f3f86bec
npm ERR! fatal: unable to access 'https://github.com/adobe-webplatform/eve.git/': OpenSSL SSL_read: Connection was reset, errno 10054
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2022-03-22T09_26_42_966Z-debug.log

C:\Users\Administrator\Desktop\wss-taskcore-web>

 

解决方法:

 

配置Github主机地址在hosts文件中:

140.82.114.4 github.com
185.199.108.133 raw.githubusercontent.com
185.199.109.133 raw.githubusercontent.com
185.199.110.133 raw.githubusercontent.com
185.199.111.133 raw.githubusercontent.com

 

INSTALL命令追加镜像地址:

npm install --save node-sass --registry=https://registry.npm.taobao.org --disturl=https://npm.taobao.org/dist --sass-binary-site=http://npm.taobao.org/mirrors/node-sass

 

构建成功:

C:\Users\Administrator\Desktop\wss-taskcore-web>npm install --save node-sass --registry=https://registry.npm.taobao.org --disturl=https://npm.taobao.org/dist --sass-binary-site=http://npm.taobao.org/mirrors/node-sass
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.

> yorkie@2.0.0 install C:\Users\Administrator\Desktop\wss-taskcore-web\node_modules\yorkie
> node bin/install.js

setting up Git hooks
can't find .git directory, skipping Git hooks installation

> husky@1.3.1 install C:\Users\Administrator\Desktop\wss-taskcore-web\node_modules\husky
> node husky install

husky > setting up git hooks
Can't find .git, skipping Git hooks installation.
Please check that you're in a cloned repository or run 'git init' to create an empty Git repository and reinstall husky.

> node-sass@4.14.1 install C:\Users\Administrator\Desktop\wss-taskcore-web\node_modules\node-sass
> node scripts/install.js

Downloading binary from http://npm.taobao.org/mirrors/node-sass/v4.14.1/win32-x64-72_binding.node
Download complete..] - :
Binary saved to C:\Users\Administrator\Desktop\wss-taskcore-web\node_modules\node-sass\vendor\win32-x64-72\binding.node
Caching binary to C:\Users\Administrator\AppData\Roaming\npm-cache\node-sass\4.14.1\win32-x64-72_binding.node

> core-js@2.6.11 postinstall C:\Users\Administrator\Desktop\wss-taskcore-web\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)


> core-js-pure@3.8.1 postinstall C:\Users\Administrator\Desktop\wss-taskcore-web\node_modules\core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"


> ejs@2.7.4 postinstall C:\Users\Administrator\Desktop\wss-taskcore-web\node_modules\ejs
> node ./postinstall.js

Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/)


> core-js@3.6.5 postinstall C:\Users\Administrator\Desktop\wss-taskcore-web\node_modules\tui-chart\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"


> node-sass@4.14.1 postinstall C:\Users\Administrator\Desktop\wss-taskcore-web\node_modules\node-sass
> node scripts/build.js

Binary found at C:\Users\Administrator\Desktop\wss-taskcore-web\node_modules\node-sass\vendor\win32-x64-72\binding.node
Testing binary
Binary is fine

> vis-network@7.6.2 postinstall C:\Users\Administrator\Desktop\wss-taskcore-web\node_modules\vis-network
> opencollective postinstall || exit 0

'opencollective' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.12 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.12: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ node-sass@4.14.1
added 2008 packages from 1981 contributors in 258.667s

33 packages are looking for funding
  run `npm fund` for details


C:\Users\Administrator\Desktop\wss-taskcore-web>

 

posted @ 2022-03-22 18:06  emdzz  阅读(485)  评论(0编辑  收藏  举报