vue3 cli创建项目运行

vue3 cli创建项目运行

使用vue cli创建一个项目

[php]vue create test[/php]

然后

[php]cd test[/php]

最后在文件夹上运行

[php]npm run serve[/php]

在Node.js v17.1.0最新版运行时报错,错误代码如下:

Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:67:19)
at Object.createHash (node:crypto:130:10)
at module.exports (F:\nodejs\liuyp\node_modules\webpack\lib\util\createHash.js:135:53)
at NormalModule._initBuildHash (F:\nodejs\liuyp\node_modules\webpack\lib\NormalModule.js:417:16)
at handleParseError (F:\nodejs\liuyp\node_modules\webpack\lib\NormalModule.js:471:10)
at F:\nodejs\liuyp\node_modules\webpack\lib\NormalModule.js:503:5
at F:\nodejs\liuyp\node_modules\webpack\lib\NormalModule.js:358:12
at F:\nodejs\liuyp\node_modules\loader-runner\lib\LoaderRunner.js:373:3
at iterateNormalLoaders (F:\nodejs\liuyp\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
at Array. (F:\nodejs\liuyp\node_modules\loader-runner\lib\LoaderRunner.js:205:4)
at Storage.finished (F:\nodejs\liuyp\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:55:16)
at F:\nodejs\liuyp\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:91:9
at F:\nodejs\liuyp\node_modules\graceful-fs\graceful-fs.js:123:16
at FSReqCallback.readFileAfterClose as oncomplete {
opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ],
library: ‘digital envelope routines’,
reason: ‘unsupported’,
code: ‘ERR_OSSL_EVP_UNSUPPORTED’
}

Node.js v17.1.0

在Unix这个错误时执行

[php]export NODE_OPTIONS=–openssl-legacy-provider[/php]

在Windows时这个错误执行下面语句

[php] set NODE_OPTIONS=–openssl-legacy-provider [/php]

发表评论

© 2022. powered by PHP 个人小站