question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

create-react-app fails due to node_modules being created in a wrong directory on Windows

See original GitHub issue

Is this a bug report?

yes

Can you also reproduce the problem with npm 4.x?

(Write your answer here.)

Which terms did you search for in User Guide?

(Write your answer here if relevant.)

Environment

  1. node -v: 6.10.2
  2. npm -v:4.6.1
  3. yarn --version (if you use Yarn):
  4. npm ls react-scripts (if you haven’t ejected):

Then, specify:

  1. Operating system: windows 10
  2. Browser and version (if relevant):

Steps to Reproduce

(Write your steps here:)

  1. npm install -g create-react-app
  2. create react app name-of-my-project
  3. starts to install react, react-dom and react-scripts and before finish i get an error: Aborting Instalation

Aborting installation.
Unexpected error. Please report it as a bug:
{ Error: Cannot find module ‘C:\Users\leonel\Desktop\pseudogram\node_modules\react- scripts\package.json’
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at checkNodeVersion (C:\Users\leonel\AppData\Roaming\npm\node_modules\create-re act-app\createReactApp.js:476:23)
at getPackageName.then.then.then.packageName (C:\Users\leonel\AppData\Roaming\n pm\node_modules\create-react-app\createReactApp.js:283:7)
at process._tickCallback (internal/process/next_tick.js:109:7) code: ‘MODULE_NO T_FOUND’ }

Deleting generated file… package.json
Deleting pseudogram / from C:\Users\leonel\Desktop
Done.

Expected Behavior

I expect it create the folder project

Actual Behavior

Aborting installation.
Unexpected error. Please report it as a bug:
{ Error: Cannot find module ‘C:\Users\leonel\Desktop\pseudogram\node_modules\react- scripts\package.json’
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at checkNodeVersion (C:\Users\leonel\AppData\Roaming\npm\node_modules\create-re act-app\createReactApp.js:476:23)
at getPackageName.then.then.then.packageName (C:\Users\leonel\AppData\Roaming\n pm\node_modules\create-react-app\createReactApp.js:283:7)
at process._tickCallback (internal/process/next_tick.js:109:7) code: ‘MODULE_NO T_FOUND’ }

Deleting generated file… package.json
Deleting pseudogram / from C:\Users\leonel\Desktop
Done.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:51 (24 by maintainers)

github_iconTop GitHub Comments

3reactions
gaearoncommented, Oct 30, 2017

Do you remember setting this key? 😛

I thought Projects looked suspicious (it is not special for the OS, and is not a parent directory of your projects judging by the log) so I thought maybe you tried to make your shell always start in this directory, and followed a bad tutorial that messed up your system.

I googled “how to change default terminal directory on windows” which led me to this answer with a scary “it can also really mess things up” disclaimer about the other answer.

That link led me to this blog entry describing the problem: https://blogs.msdn.microsoft.com/oldnewthing/20071121-00/?p=24433/ (it’s a good blog in general btw).

Please run:

reg delete "HKLM\Software\Microsoft\Command Processor" /v AutoRun /f
reg delete "HKCU\Software\Microsoft\Command Processor" /v AutoRun /f

and then try creating an app again.

2reactions
gaearoncommented, Oct 30, 2017

More than I care to know.

Read more comments on GitHub >

github_iconTop Results From Across the Web

create-react-app, installation error ("command not found")
Step # 1:- Make sure, Node js and React js is installed globally. You can check Nodejs by node --version . If not...
Read more >
Optimizing Performance - React
If your project is built with Create React App, run: npm run build. This will create a production build of your app in...
Read more >
React JavaScript Tutorial in Visual Studio Code
Note: If you've previously installed create-react-app globally via npm install -g create-react-app , we recommend you uninstall the package using npm uninstall ...
Read more >
Tutorial: Create a Node.js and React app in Visual Studio
js source code libraries. The npm package manager simplifies library installation, updating, and uninstallation. What is React? React is a front ...
Read more >
STOP Using Create React App - YouTube
Create React App is a plague and we're here to cure it. Please use Vite, NextJS, or Remix instead. Seriously, anything is better...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found