0

I've created a react app, but I am struggling with a problem which it is caused in npm start. The error pops up whenever I use the command react-scripts start on my windows 7 32 bit OS.

(NOTE: I used npx create-react-app my-react to creatr the app)

Here is the error :


> [email protected] start D:\WEB DEVELOPMENT\MyReact\my-react
> react-scripts start

internal/modules/cjs/loader.js:628
  throw e;
  ^

Error: No valid exports main found for 'D:\WEB DEVELOPMENT\MyReact\my-react\node_modules\postcss-safe-parser\node_modules\postcss'
←[90m    at resolveExportsTarget (internal/modules/cjs/loader.js:625:9)←[39m
←[90m    at applyExports (internal/modules/cjs/loader.js:502:14)←[39m
←[90m    at resolveExports (internal/modules/cjs/loader.js:551:12)←[39m
←[90m    at Function.Module._findPath (internal/modules/cjs/loader.js:657:22)←[39m
←[90m    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:960:27)←[39m
←[90m    at Function.Module._load (internal/modules/cjs/loader.js:855:27)←[39m
←[90m    at Module.require (internal/modules/cjs/loader.js:1033:19)←[39m
←[90m    at require (internal/modules/cjs/helpers.js:72:18)←[39m
    at Object.<anonymous> (D:\WEB DEVELOPMENT\MyReact\my-react\node_modules\←[4mpostcss-safe-parser←[24m\lib\safe-parse.js:1:17)
←[90m    at Module._compile (internal/modules/cjs/loader.js:1144:30)←[39m {
  code: ←[32m'MODULE_NOT_FOUND'←[39m
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `react-scripts start`
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!     D:\ALL~FILE\APPS\Roaming\npm-cache\_logs\2021-03-20T16_33_30_649Z-debug.log ```
2
  • Can you share your project files (js,html,css)? Commented Mar 20, 2021 at 17:03
  • what's your node version? Commented Mar 20, 2021 at 17:04

1 Answer 1

1

You can try this:

  1. Delete node_modules folder
  2. Delete the package-lock.json file which is at the root of your repository
  3. Run these commands: npm install and then npm start

Explanation: It looks like some packages were installed incorrectly. These instructions will uninstall the various packages your react app needs to run propertly, and install them again.

Sign up to request clarification or add additional context in comments.

2 Comments

You might try to check if you have the latest version of node.js installed
I have 13.4 version of nodejs. As Windows 7 no longer support the newest versions 😶

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.