facebook / create-react-app

Set up a modern web app by running one command.
https://create-react-app.dev
MIT License
102.69k stars 26.84k forks source link

ERROR: Cannot find module node_modules\react-scripts\package.json #4702

Closed rubenssantos2 closed 6 years ago

rubenssantos2 commented 6 years ago

Is this a bug report?

Yes

Did you try recovering your dependencies?

Yes $ npm --version 5.6.0

Which terms did you search for in User Guide?

create-react-app cannot node_modules\react-scripts\package.json

Environment

npx: installed 1 in 2.304s Path must be a string. Received undefined C:\Program Files\nodejs\node_modules\create-react-app\index.js

Environment: OS: Windows 7 Node: 8.11.3 Yarn: Not Found npm: Watchman: Not Found Xcode: N/A Android Studio: Not Found

ERROR: package.json not found!

Steps to Reproduce

  1. npm install -g create-react-app
  2. create-react-app cdc-admin

Expected Behavior

Create a directory with the App

Actual Behavior

Nothing and shows that Error:

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...

Aborting installation.
Unexpected error. Please report it as a bug:
{ Error: Cannot find module 'C:\Program Files\VertrigoServ\www\estudo\React\app-teste\cdc-admin\node_modules\react-scripts\package.json'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at checkNodeVersion (C:\Program Files\nodejs\node_modules\create-react-app\createReactApp.js:514:23)
    at getPackageName.then.then.then.packageName (C:\Program Files\nodejs\node_modules\create-react-app\createReactApp.js:312:7)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7) code: 'MODULE_NOT_FOUND' }

Deleting generated file... package.json

Reproducible Demo

rodopadro commented 6 years ago

I couldn't reproduce the bug following the steps given in this environment: OS: macOS High Sierra Node: 8.11.3 Yarn: Not Found npm: Watchman: Not Found Android Studio: Not Found

rubenssantos2 commented 6 years ago

Someone to help?

Timer commented 6 years ago

Please make sure you're on the latest version of npm (which is 6+) and then try this again. If it's still broken, please open an issue with npm as this bug is likely on their end and not ours. Thanks!