DEV Community

Sean Atukorala
Sean Atukorala

Posted on

11 1

[Solved] Error: Cannot find module '...' node:internal/modules/cjs/loader:936

Problem

Running into the following error when trying to run a React application with npm start:

$ npm start

> frontend@0.1.0 start
> react-scripts start

'ReactJSExampleApps\node-react-ecommerce\frontend\node_modules\.bin\' is not recognized as an internal or external command,
operable program or batch file.
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module 'C:\Users\sheha\OneDrive\Documents\react-scripts\bin\react-scripts.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
Enter fullscreen mode Exit fullscreen mode

Solution:

There are a number of possible causes for this problem, but in my case it was because the parent directory containing my React app was named in the format Next&ReactApps. The presence of the & caused npm to not be able to navigate into the React app's root directory and therefore was throwing these Cannot find module errors. To fix this, make sure to remove the & from the names of any directories in the path to your React applications.

Conclusion

Well this is the end of the article, if you have any questions or concerns please feel free to post a comment in this article and I will get back to you if I find the time.

I hope you found this article helpful. Thanks so much for reading my article! Feel free to follow me on Twitter and GitHub, connect with me on LinkedIn and subscribe to my YouTube channel.

The AI era means ongoing career reinvention. Join DEV.

It takes one minute and is worth it for your career.

Get started

Top comments (1)

Collapse
 
susheel4115 profile image
Mr.Susheel Kumar •

Thanks bruh saved me

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

đź‘‹ Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay