Error: Command "npm run build" exited with 1

Hello all,

I’m having problem redeploying my frontity project to vercel. I used to deploy succefully. Ever since I upgraded node to 18 I couldn’t run the app.

I downgraded node to v.16.18.1 and was able to run frontity locally. But I still can’t deploy to vercel.

The error is the following:
Error: error:0308010C:digital envelope routines::unsupported
09:45:21.927 at new Hash (node:internal/crypto/hash:71:19)
09:45:21.927 at Object.createHash (node:crypto:133:10)
09:45:21.928 at module.exports (/vercel/path0/node_modules/webpack/lib/util/createHash.js:135:53)
09:45:21.928 at NormalModule._initBuildHash (/vercel/path0/node_modules/webpack/lib/NormalModule.js:417:16)
09:45:21.928 at handleParseError (/vercel/path0/node_modules/webpack/lib/NormalModule.js:471:10)
09:45:21.928 at /vercel/path0/node_modules/webpack/lib/NormalModule.js:503:5
09:45:21.928 at /vercel/path0/node_modules/webpack/lib/NormalModule.js:358:12
09:45:21.928 at /vercel/path0/node_modules/loader-runner/lib/LoaderRunner.js:373:3
09:45:21.929 at iterateNormalLoaders (/vercel/path0/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
09:45:21.929 at iterateNormalLoaders (/vercel/path0/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
09:45:21.929 at /vercel/path0/node_modules/loader-runner/lib/LoaderRunner.js:236:3
09:45:21.929 at context.callback (/vercel/path0/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
09:45:21.930 at /vercel/path0/node_modules/babel-loader/lib/index.js:59:71
09:45:21.961 Error: Command “npm run build” exited with 1.

I also have npm 8.19.2 installed.

Any ideas?

Thanks in advance!

Same here…

OKey guys, I have an update for this. I did a lot of investigation and looking at resources and PRs from the vercel team.
So because there is now node 18.x you actually need to specify the node version in the engines in your package.json, like this:

  "engines": {
    "node": "16.x"

At first I thought its a bug as based on my testing, when using a custom builder the engines property was ignored. I talked to some engineers at vercel and they said that its not a bug, it simply didnt affect out build before, because 16.x was the latest available version or something like this.
I will also share this same message here: WARNING: All your builds using @frontity/now will break as of August 9th 2022 - #18 by anantajitjg as this is where we were tracking a similar issue.

1 Like

Thank you for the quick response. For me it still gives the same issue.
I tried all the node I have, and no change. here:

You need to do it exactly like in the code i pasted. It wont work with anything higher than version 16. So just replace the engines part you have with this:

  "engines": {
    "node": "16.x"
1 Like

Well, I hate to bug you again but I did everything in my power but still get this error. (Back on friday this code had no useState probem)

Had the same issue before, and spent some time debugging it. Fix is quite easy:

  1. Remove node_modules folder from project root
  2. Delete package-lock.json
  3. Run npm i
  4. Profit

Did it, still gives the same error back. I also tried from other PC-s, older and newer commits as well. Nothing seems to work, I am really under the weather because of this issue. :frowning:

I everyone I have the same issue if someone have the solution :slight_smile:

Can you guys try to make a sandbox with from your repo to see if it still behaves like this? Then we know if its an issue with your own env or if its from something else.
I am quite busy those days but I will try to help u as much as possible.

Hey guys,
Good news! Using yarn did the trick.
Try the following steps:

  • Delete: node modules and package-lock.json (also build if you have).
  • Have package.json node set to ‘16.x’:
"node": "16.x",
  • Frontity doesnt run on React18, so downgrade to 16:
npm install --save [email protected] [email protected]
  • Downgrade to node 16 (you need to have nvm and node 16.18.1 installed):
nvm use 16.18.1
  • Now install yarn:
npm install --global yarn
  • Run yarn (is simulates the “npm install” command)
  • Last step is run develop:
yarn frontity dev

If you have error messages during these steps, put them here so we can have a look at. I also had some dependencies which gave back an error because they did not work with react 16 or node 16, I had to uninstall those dependecies and find other solution.

1 Like

how and where do i add the node:16x can you take a screenshote of your code

@dev here, in the package.json file, engines property.

I have followed the steps and i got this error.

Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:71:19)
at Object.createHash (node:crypto:133:10)
at module.exports (C:\Users\User\Desktop\Next.js\ReactWordpress\test-app\node_modules\webpack\lib\util\createHash.js:135:53)
at NormalModule._initBuildHash (C:\Users\User\Desktop\Next.js\ReactWordpress\test-app\node_modules\webpack\lib\NormalModule.js:417:16)
at handleParseError (C:\Users\User\Desktop\Next.js\ReactWordpress\test-app\node_modules\webpack\lib\NormalModule.js:471:10)
at C:\Users\User\Desktop\Next.js\ReactWordpress\test-app\node_modules\webpack\lib\NormalModule.js:503:5
at C:\Users\User\Desktop\Next.js\ReactWordpress\test-app\node_modules\webpack\lib\NormalModule.js:358:12
at C:\Users\User\Desktop\Next.js\ReactWordpress\test-app\node_modules\loader-runner\lib\LoaderRunner.js:373:3
at iterateNormalLoaders (C:\Users\User\Desktop\Next.js\ReactWordpress\test-app\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
at iterateNormalLoaders (C:\Users\User\Desktop\Next.js\ReactWordpress\test-app\node_modules\loader-runner\lib\LoaderRunner.js:221:10)
error Command failed with exit code 1.
info Visit yarn run | Yarn for documentation about this command.