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.

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (1)

Collapse
 
susheel4115 profile image
Mr.Susheel Kumar

Thanks bruh saved me

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay