0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

npm run buildの際にBuilding for production...Errorが出る

Posted at

久々の投稿です、
現在は、派遣でエンジニアしてます。
来年の2月からフリーランスになります!!

次の現場では、vueを使うので勉強していて
問題にぶつかりました。

npm run build時に下記のエラーが出ました。

kushiyama_makoto@MakotonoMacBook-Air udemy-vuejs % npm run build    

> udemy-vuejs@0.1.0 build
> vue-cli-service build


⠹  Building for production...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 (/Users/kushiyama_makoto/udemy-vuejs/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/Users/kushiyama_makoto/udemy-vuejs/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/Users/kushiyama_makoto/udemy-vuejs/node_modules/webpack/lib/NormalModule.js:471:10)
    at /Users/kushiyama_makoto/udemy-vuejs/node_modules/webpack/lib/NormalModule.js:503:5
    at /Users/kushiyama_makoto/udemy-vuejs/node_modules/webpack/lib/NormalModule.js:358:12
    at /Users/kushiyama_makoto/udemy-vuejs/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/Users/kushiyama_makoto/udemy-vuejs/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at iterateNormalLoaders (/Users/kushiyama_makoto/udemy-vuejs/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
    at /Users/kushiyama_makoto/udemy-vuejs/node_modules/loader-runner/lib/LoaderRunner.js:236:3
    at runSyncOrAsync (/Users/kushiyama_makoto/udemy-vuejs/node_modules/loader-runner/lib/LoaderRunner.js:130:11)
    at iterateNormalLoaders (/Users/kushiyama_makoto/udemy-vuejs/node_modules/loader-runner/lib/LoaderRunner.js:232:2)
    at Array.<anonymous> (/Users/kushiyama_makoto/udemy-vuejs/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/Users/kushiyama_makoto/udemy-vuejs/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
    at /Users/kushiyama_makoto/udemy-vuejs/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
/Users/kushiyama_makoto/udemy-vuejs/node_modules/loader-runner/lib/LoaderRunner.js:114
                        throw e;
                        ^

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 (/Users/kushiyama_makoto/udemy-vuejs/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/Users/kushiyama_makoto/udemy-vuejs/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/Users/kushiyama_makoto/udemy-vuejs/node_modules/webpack/lib/NormalModule.js:471:10)
    at /Users/kushiyama_makoto/udemy-vuejs/node_modules/webpack/lib/NormalModule.js:503:5
    at /Users/kushiyama_makoto/udemy-vuejs/node_modules/webpack/lib/NormalModule.js:358:12
    at /Users/kushiyama_makoto/udemy-vuejs/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/Users/kushiyama_makoto/udemy-vuejs/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at /Users/kushiyama_makoto/udemy-vuejs/node_modules/loader-runner/lib/LoaderRunner.js:186:6
    at context.callback (/Users/kushiyama_makoto/udemy-vuejs/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at /Users/kushiyama_makoto/udemy-vuejs/node_modules/cache-loader/dist/index.js:240:7
    at /Users/kushiyama_makoto/udemy-vuejs/node_modules/neo-async/async.js:2830:7
    at done (/Users/kushiyama_makoto/udemy-vuejs/node_modules/neo-async/async.js:2865:11)
    at /Users/kushiyama_makoto/udemy-vuejs/node_modules/neo-async/async.js:2818:7
    at Array.<anonymous> (/Users/kushiyama_makoto/udemy-vuejs/node_modules/cache-loader/dist/index.js:229:9) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v17.3.0

正直わからん状態でしたが、ググった結果下記のコマンドで解決しました。

export NODE_OPTIONS=--openssl-legacy-provider

nodeの設定を追加したみたいですね。

一応、下記のURLを参考にしました。
https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported

確認してみてください!!!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?