react-storefront
react-storefront copied to clipboard
Web pack Error while running a npm start && npm run build command
Bug report
I am using MacOs 11.2.1 and I have tried to install / run and deploy react-storefront using several methods. All have failed me.
Describe the bug
- I used standard MacoS NodeJS v12.18.3, NPM v6.14.6. and I ran the commands from the docs:
npm install
npm start or npm run build
When I run npm start I am presented with the following error:
internal/modules/cjs/loader.js:968
throw err;
^
Error: Cannot find module 'webpack'
Require stack:
- /Users/gis00217/Documents/my-doc/arun/myreact-app/next.config.js
- /Users/gis00217/Documents/my-doc/arun/myreact-app/node_modules/next/dist/next-server/server/config.js
- /Users/gis00217/Documents/my-doc/arun/myreact-app/node_modules/next/dist/next-server/server/next-server.js
- /Users/gis00217/Documents/my-doc/arun/myreact-app/node_modules/next/dist/server/next.js
- /Users/gis00217/Documents/my-doc/arun/myreact-app/server.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
at Function.Module._load (internal/modules/cjs/loader.js:841:27)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/Users/gis00217/Documents/my-doc/arun/myreact-app/next.config.js:1:17)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at loadConfig (/Users/gis00217/Documents/my-doc/arun/myreact-app/node_modules/next/dist/next-server/server/config.js:8:94)
at new Server (/Users/gis00217/Documents/my-doc/arun/myreact-app/node_modules/next/dist/next-server/server/next-server.js:1:4533)
at new DevServer (/Users/gis00217/Documents/my-doc/arun/myreact-app/node_modules/next/dist/server/next-dev-server.js:1:2964)
at createServer (/Users/gis00217/Documents/my-doc/arun/myreact-app/node_modules/next/dist/server/next.js:2:607)
at Object.<anonymous> (/Users/gis00217/Documents/my-doc/arun/myreact-app/server.js:14:13) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/gis00217/Documents/my-doc/arun/myreact-app/next.config.js',
'/Users/gis00217/Documents/my-doc/arun/myreact-app/node_modules/next/dist/next-server/server/config.js',
'/Users/gis00217/Documents/my-doc/arun/myreact-app/node_modules/next/dist/next-server/server/next-server.js',
'/Users/gis00217/Documents/my-doc/arun/myreact-app/node_modules/next/dist/server/next.js',
'/Users/gis00217/Documents/my-doc/arun/myreact-app/server.js'
]
}
[nodemon] app crashed - waiting for file changes before starting...
Expected behavior
The site is supposed to start on localhost:3000 .
Screenshots
System information
- OS: macOS
- Version of React Storefront: 8.0.0
Additional context
Add any other context about the problem here.
I got past this by installing webpack (version 4)
npm i [email protected]
Facing strange issues with react-storefront, Not really as fast as they advertise. Configuration takes a ton of time. I literally spent hours trying to fix the webpack issue.
Most notorious one Next (node:80537) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. Next (node:80537) UnhandledPromiseRejectionWarning: TypeError: Invalid value used as weak map key at WeakMap.set (<anonymous>)
@NeonMando158 You have to install webpack v4.