1. 程式人生 > 其它 >【Vue】NPM構建的一些問題解決

【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>