Open nathanhannig opened 7 years ago
This is related to lesson 3.6 - State Management - PropTypes
To recreate,
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.
test@0.1.0 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! test@0.1.0 start: react-scripts start
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the test@0.1.0 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`
Can you also post your node
and creact-react-app
version that you're using ?
node --version v6.11.0
create-react-app --version 1.3.3
npm --version 5.3.0
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.
any solution?
@ardithastopalli using the command yarn install
and starting the server again using yarn start
resolves the issue for me.
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.