Documentation
-
Home
-
Getting Started
-
Common Tasks
-
The Servd Plugin
-
Project Settings
-
Domains & SSL
-
Importing & Cloning
-
Assets
-
Logs
-
Plans and Billing
-
Addons
-
Team & Project Management
-
Project Security
-
Your Account
-
Troubleshooting
-
Restart Instances
-
Repair Database
-
Craft isn't installed yet
-
Speeding Up Your Project
-
My Uploaded Assets Are Disappearing
-
My Sessions Are Expiring Too Soon
-
Why Are My Environments Behaving Differently?
-
No URL found for submodule path
-
Composer and Private Repositories
-
Composer out of memory errors
-
An SSL certificate for a domain has failed to generate or renew
-
Animated GIFs Displaying Incorrectly
-
Out of memory whilst running CLI tasks
-
CloudFlare: domain already exists
-
Permission Denied Whilst Generating PDFs
-
"server reached max_children setting (5), consider raising it"
-
Missing composer "allow-plugins" config
-
Unexpected robots.txt Content
-
Why is Servd is slower than my old VPS server?
-
Error: headers already sent
-
Where's the node_modules directory?
-
-
Cookbook
-
Now & Next
-
The Small Print
Where's the node_modules directory?
I've set up my node step build and have a package.json committed to my git repository, but when I create and sync a bundle there isn't a node_modules directory on the filesystem. Has the npm install command failed?
If you have a node build step set up, you might notice that the node_modules directory isn't included in your bundles. This is done intentionally for a few reasons:
- Deploy speed - By excluding them from the bundle, we make deployments a lot faster. Sometimes the node_modules directory can reach hundreds of megabytes, which has to be downloaded by our platform when synced to one of your project environments.
- Security - Often old, unmaintained or unpatched npm packages can present security exploits when stored on your web server, so it's often safer to discard then afterwards.
- Redundant - Most of time the node_modules aren't needed once the front-end assets have been compiled.
- Node isn't installed - By default, we don't have Node installed on our PHP instances so any JS files can't be executed.
If this presents a problem for your project, feel free to get in touch via our support and we can work something out.