'I cannot run npm start with Webpack 5. I get a large object output and 2 errors
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! [email protected] open:src: `babel-node tools/srcServer.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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! [email protected] start: `npm-run-all --parallel open:src`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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?
Solution 1:[1]
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Bernát |
