I cannot run npm start with Webpack 5. I get a large object output and 2 errors

Viewed 170

As the title says, I am having issues running npm start after upgrading to Webpack 5. I cannot fit the whole object, so here are the last few lines of the object that is returned:

  headerName: 'Webpack',
  baseDataPath: 'configuration',
  postFormatter: [Function: postFormatter]
}

These are the errors:

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! frontend-app@11.3.93 open:src: `babel-node tools/srcServer.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the frontend-app@11.3.93 open:src script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user1\AppData\Roaming\npm-cache\_logs\2022-03-29T17_53_33_649Z-debug.log
ERROR: "open:src" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! frontend-app@11.3.93 start: `npm-run-all --parallel open:src`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the frontend-app@11.3.93 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user1\AppData\Roaming\npm-cache\_logs\2022-03-29T17_53_33_691Z-debug.log

Has anyone else encountered this issue?

1 Answers

You can see the real error message with less, but the output is on STDERR, so you need to redirect it to STDOUT:

$ npm start 2>&1 | less

For me it was a configuration error, I was still using Webpack 4 style keys in module.rules.

Related