Forums

npm run build fails

Hi, I'm trying to build a production-ready React app and after running npm run build I get this error output:

npm ERR! Linux 5.4.0-1020-aws
npm ERR! argv "node" "/usr/bin/npm" "run" "build"
npm ERR! node v8.16.2
npm ERR! npm  v4.3.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! client@0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the client@0.1.0 build script 'react-scripts build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the client package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     react-scripts build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs client
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls client
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/markalexa/.npm/_logs/2021-01-25T21_46_41_150Z-debug.log

PA appears to be using npm v4.3 (though most recent version is 6.14) Does the build fail because of older version of npm installed ? The error output points to it.

Any feedback much appreciated.

Yes, our default version of Node is pretty old (at least by JavaScript release-every-ten-minutes standards ;-) but you can upgrade to a more recent version using NVM.