Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

installing prop-types manually appears to destroy react-scripts #2

Open
nathanhannig opened this issue Jul 31, 2017 · 6 comments
Open

Comments

@nathanhannig
Copy link

After manually installing prop-types as instructed the react-scripts folder appears to be one of many node modules removed automatically by npm for some reason.

So when npm start is ran from command line, the react-scripts gives an error as it cannot be found.

@nathanhannig
Copy link
Author

nathanhannig commented Jul 31, 2017

This is related to lesson 3.6 - State Management - PropTypes

To recreate,

  1. install create-react-app
  2. create a test project using create react app
  3. cd into the project
  4. run npm install --save prop-types
  5. run npm start

At this point you should see a number of errors similar to the below.

`Last login: Mon Jul 31 14:30:42 on ttys002
➜ ~ cd Documents
➜ Documents cd udacity
➜ udacity cd test
➜ test npm install --save prop-types
npm WARN gentlyRm not removing /Users/nathan/Documents/udacity/test/node_modules/.bin/jest as it wasn't installed by /Users/nathan/Documents/udacity/test/node_modules/jest
npm WARN gentlyRm not removing /Users/nathan/Documents/udacity/test/node_modules/.bin/uglifyjs as it wasn't installed by /Users/nathan/Documents/udacity/test/node_modules/uglify-js
npm WARN gentlyRm not removing /Users/nathan/Documents/udacity/test/node_modules/html-minifier/node_modules/.bin/uglifyjs as it wasn't installed by /Users/nathan/Documents/udacity/test/node_modules/html-minifier/node_modules/uglify-js
npm WARN gentlyRm not removing /Users/nathan/Documents/udacity/test/node_modules/espree/node_modules/.bin/acorn as it wasn't installed by /Users/nathan/Documents/udacity/test/node_modules/espree/node_modules/acorn
npm WARN gentlyRm not removing /Users/nathan/Documents/udacity/test/node_modules/.bin/browserslist as it wasn't installed by /Users/nathan/Documents/udacity/test/node_modules/browserslist
npm WARN gentlyRm not removing /Users/nathan/Documents/udacity/test/node_modules/autoprefixer/node_modules/.bin/browserslist as it wasn't installed by /Users/nathan/Documents/udacity/test/node_modules/autoprefixer/node_modules/browserslist
npm notice created a lockfile as package-lock.json. You should commit this file.

  • [email protected]
    removed 1136 packages and updated 16 packages in 11.247s
    ➜ test npm start

[email protected] start /Users/nathan/Documents/udacity/test
react-scripts start

sh: react-scripts: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] start: react-scripts start
npm ERR! spawn ENOENT
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! /Users/nathan/.npm/_logs/2017-07-31T22_10_28_189Z-debug.log
➜ test`

@ghoshabhi
Copy link

Can you also post your node and creact-react-app version that you're using ?

@nathanhannig
Copy link
Author

node --version
v6.11.0

create-react-app --version
1.3.3

npm --version
5.3.0

@nathanhannig
Copy link
Author

I have determined the issue is related to yarn and npm being both installed.

When create-react-app is used to create the project and yarn is installed, it appears that it expects future installs to be performed using the yarn commands.

Many students are installing yarn because of the video in Lesson 2.3. https://www.youtube.com/watch?time_continue=10&v=WmYSd7OEjMM

However, follow up lessons provide the install of packages using npm commands.

The causes a conflict of control between yarn and npm.

Once I uninstalled yarn and created a new create-react-app project, I no longer received these issues.

I believe a warning needs to be added to the lesson and youtube video mentioned above.

@ardithastopalli
Copy link

any solution?

@anandprabhu
Copy link

@ardithastopalli using the command yarn install and starting the server again using yarn start resolves the issue for me.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants