Deploy with Gatsby Is Hanging

Hi there,

the beauty of package management (by tools such as yarn, npm, etc) is that you don’t need to upload the node_modules folder - in fact, you shouldn’t! It’s often very large and unwieldy. I’m not 100% sure this is true, but it is very likely we explicitly prohibit you from uploading those files.

Instead, the package.json file contains information about which packages your project requires.

Our service is configured to look at your project, specifically, your package.json file, read it, understand which packages it needs, then trigger a download to fetch those packages and install them - our servers talk to the servers where the packages are hosted and coordinate that all on their own. That’s where the node_modules folder comes from - it is generated by npm and the package contents are stored there.

The .cache file contains information that is generated automatically - and @luke can verify this, but the .netlify file is also automatically generated, I believe.

In essence, in order to deploy a project that configures itself the most important file is the package.json.

you should prohibit the upload to github of those files (node_modules, and the .netlify and .cache) files with a .gitignore, ideally. I have a feeling it won’t hang any more. Keep us posted.

1 Like