0

I've been having issues running "yarn build" for a few days now. I tried the suggestions I could find online without much luck. This is for an NFT project on Solana so hoping another dev on here may have ran into and has the fix.

Things I've tried:

  1. Downgrading to earlier versions of node js, ts-node, yarn, and solana.
  2. Deleting package-lock.json.

Any other suggestions out there would be much appreciated. Thanks in advance!

Command line output below:

C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js>yarn build
yarn run v1.22.10
$ lerna run build
lerna notice cli v3.22.1
lerna info versioning independent
lerna info Executing command in 5 packages: "yarn run build"
lerna ERR! yarn run build exited 1 in 'candy-machine-mint'
lerna ERR! yarn run build stdout:
$ react-scripts build
Creating an optimized production build...
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

lerna ERR! yarn run build stderr:
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 (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\webpack\lib\util\createHash.js:135:53)
    at NormalModule._initBuildHash (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\webpack\lib\NormalModule.js:417:16)
    at handleParseError (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\webpack\lib\NormalModule.js:471:10)
    at C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\webpack\lib\NormalModule.js:503:5
    at C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\webpack\lib\NormalModule.js:358:12
    at C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\loader-runner\lib\LoaderRunner.js:373:3
    at iterateNormalLoaders (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
    at iterateNormalLoaders (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\loader-runner\lib\LoaderRunner.js:221:10)
    at C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\loader-runner\lib\LoaderRunner.js:236:3
    at runSyncOrAsync (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\loader-runner\lib\LoaderRunner.js:130:11)
    at iterateNormalLoaders (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\loader-runner\lib\LoaderRunner.js:232:2)
    at Array.<anonymous> (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\loader-runner\lib\LoaderRunner.js:205:4)
    at Storage.finished (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:55:16)
    at C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:91:9
C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\packages\fair-launch\node_modules\react-scripts\scripts\build.js:19
  throw err;
  ^

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 (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\webpack\lib\util\createHash.js:135:53)
    at NormalModule._initBuildHash (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\webpack\lib\NormalModule.js:417:16)
    at C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\webpack\lib\NormalModule.js:452:10
    at C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\webpack\lib\NormalModule.js:323:13
    at C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\loader-runner\lib\LoaderRunner.js:367:11
    at C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\loader-runner\lib\LoaderRunner.js:233:18
    at context.callback (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
    at C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\babel-loader\lib\index.js:59:103 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v17.2.0
error Command failed with exit code 1.

lerna ERR! yarn run build exited 1 in 'candy-machine-mint'
lerna WARN complete Waiting for 2 child processes to exit. CTRL-C to exit immediately.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

1 Answers1

0

It is the node.js version used with old code that is causing the error. Uninstall the current version of node and install the lts version (16.13.1) and the error will be gone.

Kalle
  • 150
  • 6
  • 1
    Negative. I have tried the lts version which is why I tried downgrading (14.18.0) as mentioned. I tried the lts version again just for a sanity check myself and the problem still exists. – Cormac Kennedy Dec 14 '21 at 01:35
  • You could add --openssl-legacy-provider to your build script in package.json but you need to be aware that you will be running insecure ssl. Did you removed your previous node.js version? Also as suggested you should try the latest lts version (16.13.1). https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported – Kalle Dec 14 '21 at 10:19