You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When deploying the WebApp to a server like Heroku or Google Cloud, these platforms install dependencies but ignore devDependencies, which make total sense.
When this happens the app crashes on start because it can't find 'commander'.
When looking at who depends on this package:
'newman' is right now included as a devDependency and should be moved to 'dependencies'.
Steps To Reproduce
I don't know exactly how Google Cloud or Heroku setup applications internally, so here's what I'm doing to run the app without dev dependencies:
Clone repo.
Navigate to WebApp.
npm install #(this will install both dev and prod dependencies)
npm run build #(use dev dependencies to generate build)
delete node_modules folder
Remove the 'prestart' and 'postinstall' commands from package.json. This is triggering a npm install and it will install dev dependencies again, which we are trying to avoid.
npm install --only=prod #(make sure we don't install dev dependencies)
npm start
And the result is:
Error: Cannot find module 'commander'
Because this is included through newman dependencies, and should be included as a dependency for this package directly.
Current Behavior
No response
Expected Behavior
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered:
BTW, with this fix and some minor adaptations for Heroku, I was able to deploy the app successfully.
gpiffaretti
changed the title
[BUG]: WebApp dependency is in incorrectly placed in devDependencies
[BUG]: WebApp dependency is incorrectly placed in devDependencies
Mar 15, 2022
Package version
3.1.0-exp.3
Environment
When deploying the WebApp to a server like Heroku or Google Cloud, these platforms install dependencies but ignore devDependencies, which make total sense.
When this happens the app crashes on start because it can't find 'commander'.
When looking at who depends on this package:
'newman' is right now included as a devDependency and should be moved to 'dependencies'.
Steps To Reproduce
I don't know exactly how Google Cloud or Heroku setup applications internally, so here's what I'm doing to run the app without dev dependencies:
And the result is:
Error: Cannot find module 'commander'
Because this is included through newman dependencies, and should be included as a dependency for this package directly.
Current Behavior
No response
Expected Behavior
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: