npm i 报gyp错,重新安装node,降低版本到17.9.1解决(另与openSSL相关)
npm ERR! code 128
npm ERR! git dep preparation failed
npm ERR! command D:\Program Files\nodejs\node.exe C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js install --force --cache=C:\Users\Administrator\AppData\Local\npm-cache --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm ERR! code 128
npm ERR! npm ERR! An unknown git error occurred
npm ERR! npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/adobe-webplatform/eve.git
npm ERR! npm ERR! Warning: Permanently added 'github.com,20.205.243.166' (ECDSA) to the list of known hosts.
npm ERR! npm ERR! git@github.com: Permission denied (publickey).
npm ERR! npm ERR! fatal: Could not read from remote repository.
npm ERR! npm ERR!
npm ERR! npm ERR! Please make sure you have the correct access rights
npm ERR! npm ERR! and the repository exists.
npm ERR!
npm ERR! npm ERR! A complete log of this run can be found in: C:\Users\Administrator\AppData\Local\npm-cache\_logs\2023-10-06T06_19_49_389Z-debug-0.log
npm ERR! A complete log of this run can be found in: C:\Users\Administrator\AppData\Local\npm-cache\_logs\2023-10-06T06_01_47_048Z-debug-0.log
解决办法:uninstall Node version 18.12 and install version 17.9.1
---------------------------------------------------------------------------
又报错:
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ], library: 'digital envelope routines', reason: 'unsupported', code: 'ERR_OSSL_EVP_UNSUPPORTED'
原因:node版本与openssl 不兼容导致的初始化失败
解决:
windows执行:set NODE_OPTIONS=--openssl-legacy-provider
mac执行:export NODE_OPTIONS=--openssl-legacy-provider

