facebook / prop-types

Runtime type checking for React props and similar objects
MIT License
4.48k stars 356 forks source link

installation of prop-types removes node modules #177

Closed isabellachen closed 5 years ago

isabellachen commented 6 years ago

Using create-react-app I created a react app and thereafter installed prop-types. As I installed it, I realised it was deleting a huge amount of folders and files from my node_modules folder. After changing some text in a h1 element, the app threw an error Module build failed: Error: ENOENT: no such file or directory, open '/Users/isabellachen/Developer/tutorials/wtf/node_modules/react-scripts/config/polyfills.js'

Looks like more than half the folders in my node-modules is gone.

I thereafter removed prop-types from package.json and npm i to reinstall all the dependencies and my app is up and running again.

yasircse commented 6 years ago

same here...I also created App using "create-react-app". later installed "prop-types" once prop-types got installed, i received following message

Note "prop-types" installation caused me to loose 1203 packages out of node_modules .....My App threw me an error as well.

I don't know why prop-types is causing this problem.

"temporary solution" install prop- types....then delete the whole "node_modules" folder...and run the command ...yarn install or npm install.........

ljharb commented 5 years ago

Is this still an issue? I'm not sure how it could be related to this library specifically (as opposed to a bug in npm or yarn themselves)

amitnitjsr commented 5 years ago

delete node modules npm install npm i prop-types