前言
启动项目报错error:0308010C:digital envelope routines::unsupported
,其实很简单因为node版本的原因,本地默认的版本是v20.15.0
,项目是老项目默认的版本是v16.16.0
;
内容
修复
代码语言:shell复制切换node版本并重新运行即可;nvm use v16.16.0 报错
pnpm run dev
> vue-admin-template@4.4.0 dev /Users/xxx/Documents/project/ad-admin-web
> vue-cli-service serve --mode dev
INFO Starting development server...
10% building 2/3 modules 1 active ...s/project/ad-admin-web/src/main.jsError: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:79:19)
at Object.createHash (node:crypto:139:10)
at module.exports (/Users/wangyang/Documents/project/ad-admin-web/node_modules/.pnpm/webpack@4.46.0/node_modules/webpack/lib/util/createHash.js:135:53)
at NormalModule._initBuildHash (/Users/wangyang/Documents/project/ad-admin-web/node_modules/.pnpm/webpack@4.46.0/node_modules/webpack/lib/NormalModule.js:417:16)
at handleParseError (/Users/wangyang/Documents/project/ad-admin-web/node_modules/.pnpm/webpack@4.46.0/node_modules/webpack/lib/NormalModule.js:471:10)
at /Users/wangyang/Documents/project/ad-admin-web/node_modules/.pnpm/webpack@4.46.0/node_modules/webpack/lib/NormalModule.js:503:5
at /Users/wangyang/Documents/project/ad-admin-web/node_modules/.pnpm/webpack@4.46.0/node_modules/webpack/lib/NormalModule.js:358:12
at /Users/wangyang/Documents/project/ad-admin-web/node_modules/.pnpm/loader-runner@2.4.0/node_modules/loader-runner/lib/LoaderRunner.js:373:3
at iterateNormalLoaders (/Users/wangyang/Documents/project/ad-admin-web/node_modules/.pnpm/loader-runner@2.4.0/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
at iterateNormalLoaders (/Users/wangyang/Documents/project/ad-admin-web/node_modules/.pnpm/loader-runner@2.4.0/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
at /Users/wangyang/Documents/project/ad-admin-web/node_modules/.pnpm/loader-runner@2.4.0/node_modules/loader-runner/lib/LoaderRunner.js:236:3
at runSyncOrAsync (/Users/wangyang/Documents/project/ad-admin-web/node_modules/.pnpm/loader-runner@2.4.0/node_modules/loader-runner/lib/LoaderRunner.js:130:11)
at iterateNormalLoaders (/Users/wangyang/Documents/project/ad-admin-web/node_modules/.pnpm/loader-runner@2.4.0/node_modules/loader-runner/lib/LoaderRunner.js:232:2)
at Array.<anonymous> (/Users/wangyang/Documents/project/ad-admin-web/node_modules/.pnpm/loader-runner@2.4.0/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
at Storage.finished (/Users/wangyang/Documents/project/ad-admin-web/node_modules/.pnpm/enhanced-resolve@4.5.0/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
at /Users/wangyang/Documents/project/ad-admin-web/node_modules/.pnpm/enhanced-resolve@4.5.0/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
10% building 2/5 modules 3 active ..._modules/webpack/hot/dev-server.jsnode:internal/crypto/hash:79
this[kHandle] = new _Hash(algorithm, xofLen, algorithmId, getHashCache());
^
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:79:19)
at Object.createHash (node:crypto:139:10)
at module.exports (/Users/wangyang/Documents/project/ad-admin-web/node_modules/.pnpm/webpack@4.46.0/node_modules/webpack/lib/util/createHash.js:135:53)
at NormalModule._initBuildHash (/Users/wangyang/Documents/project/ad-admin-web/node_modules/.pnpm/webpack@4.46.0/node_modules/webpack/lib/NormalModule.js:417:16)
at handleParseError (/Users/wangyang/Documents/project/ad-admin-web/node_modules/.pnpm/webpack@4.46.0/node_modules/webpack/lib/NormalModule.js:471:10)
at /Users/wangyang/Documents/project/ad-admin-web/node_modules/.pnpm/webpack@4.46.0/node_modules/webpack/lib/NormalModule.js:503:5
at /Users/wangyang/Documents/project/ad-admin-web/node_modules/.pnpm/webpack@4.46.0/node_modules/webpack/lib/NormalModule.js:358:12
at /Users/wangyang/Documents/project/ad-admin-web/node_modules/.pnpm/loader-runner@2.4.0/node_modules/loader-runner/lib/LoaderRunner.js:373:3
at iterateNormalLoaders (/Users/wangyang/Documents/project/ad-admin-web/node_modules/.pnpm/loader-runner@2.4.0/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
at Array.<anonymous> (/Users/wangyang/Documents/project/ad-admin-web/node_modules/.pnpm/loader-runner@2.4.0/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
at Storage.finished (/Users/wangyang/Documents/project/ad-admin-web/node_modules/.pnpm/enhanced-resolve@4.5.0/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
at /Users/wangyang/Documents/project/ad-admin-web/node_modules/.pnpm/enhanced-resolve@4.5.0/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
at /Users/wangyang/Documents/project/ad-admin-web/node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js:123:16
at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read/context:68:3) {
opensslErrorStack: [
'error:03000086:digital envelope routines::initialization error',
'error:0308010C:digital envelope routines::unsupported'
],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
Node.js v20.15.0
ELIFECYCLE Command failed with exit code 1.