Monday 25 March 2019

Do I still need node_modules folder after running npm build?

I've run a production build of a server-side rendered React app. So entire project includes some server-side code in Express and other client-side code in React.​Since I've run npm build to build everything together, do I usually still need the node_modules folder? That's, during deployment, do I still need to run npm install to pull all the dependencies?​At the moment, it seems like I would still need to run npm install to get the node_modules because node complains that it cannot find module 'express' until I did an npm install.​This is my first attempt at SSR and so I'm not sure about whether I would still need the node_modules folder. In most cases when I build everything through create-react-app, I never need the node_modules folder after building it.

Submitted March 25, 2019 at 06:38PM by decorumic

No comments:

Post a Comment