Skip to main content

NodeJS failed to run npm build

Comments

2 comments

  • cPRex Jurassic Moderator
    Hey there! Are you using the NodeJS provided through cPanel here? How to Install a Node.js Application | cPanel & WHM Documentation We don't require that command to get run as part of our tool, but our support for NodeJS is very limited, as outlined at the top of that document. I also see this is located in /opt/alt/alt-nodejs14 - are you using the CloudLinux Selector tool for this work? If so, it might be best to reach out to them directly as the cPanel tools use version 16.
    0
  • Karl
    Guessing you're using CloudLinux? You'll need to limit the number of threads & processes that NextJS is using. Open up your next.conf.js and add the experimental section: [QUOTE] module.exports = { experimental: { workerThreads: false, cpus: 4 } };
    You might need to adjust the cpus value still. As there's jest in there as well, you might need to tell that to run inline or limit the number of workers as well, for that you'll need to open up your package.json and check the scripts section: [QUOTE] { "scripts": { "test": "jest --maxWorkers=4" } }
    or [QUOTE] { "scripts": { "test": "jest --runInBand" } }
    You can read a bit more about the former in the blog post I wrote after solving the issue for a customer: Thanks, Karl
    0

Please sign in to leave a comment.