Search code examples
reactjsnpmnode-modulescreate-react-app

Can I copy and paste node_modules, public,src ,package.json, etc in folder created by npx create-react-app to other folder?


I am working on react application and have less Internet, Every time creating a new react-app I should do npx create-react-app which downloads about 185 MB of files. FIles Includes node_modules,src,public etc. Can I just copy and paste these basic folders from one folder to another? what are the circumstances if I use it? Is there any problem that I will face in the future?


Solution

  • While coping whole node_modules and then running npm install in the new directory should theoretically work fine (while speeding up the dependency install significantly), if you have a problem of slow internet, or low data, I’d personally recommend installing local npm proxy (registry). See eg. https://verdaccio.org/docs/en/what-is-verdaccio.html