Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devDependencies are installed by default #89

Open
SCKevinO opened this issue Sep 28, 2023 · 1 comment
Open

devDependencies are installed by default #89

SCKevinO opened this issue Sep 28, 2023 · 1 comment
Assignees
Labels

Comments

@SCKevinO
Copy link

Describe the bug
The documentation (https://doc.scalingo.com/languages/nodejs/start#install-devdependencies) say that devDependencies are not installed by default unless the NPM_CONFIG_PRODUCTION environment variable is set to false. However, they seem to be installed anyway if the env var is not defined at all.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new app on Scalingo
  2. Deploy a nodejs app containing devDependencies in their package.json
  3. Check the deploy log to see that devDependencies were installed
  4. Connect to the app with a one-off
  5. Notice that the devDependencies are present in the image
@SCKevinO SCKevinO added the bug label Sep 28, 2023
@bbougon
Copy link

bbougon commented Sep 28, 2023

Hello,

to give more insights, the dev dependencies are pruned at the end of the installation.
Nevertheless, if you have a devdependency, let's say storybook, which depends on playwright, which install firefox, chrome and webkit, the prune does not cleanup the /app/.cache that contains the installed software.

Also, my 2 cents, allowing dev dependencies to be installed when NODE_ENV=production should be avoid

@ipfaze ipfaze added dependencies Pull requests that update a dependency file and removed dependencies Pull requests that update a dependency file labels Oct 2, 2023
manuhabitela added a commit to numerique-gouv/moncomptepro that referenced this issue Mar 20, 2024
- on deploy (on scalingo), the project is built. So it uses the build
scripts using concurrently, vite and all. We make sure those deps are
available anytime we use `npm install`
- now we can set up scalingo to not install devDeps while still
succeeding in installing the project. Actually, following their docs,
scalingo shouldn't install devDeps by default but it actually does. We
should be able to use an env var to force it bypassing devDeps
(Scalingo/nodejs-buildpack#89)
manuhabitela added a commit to numerique-gouv/moncomptepro that referenced this issue Mar 20, 2024
- on deploy (on scalingo), the project is built. So it uses the build
scripts using concurrently, vite and all. We make sure those deps are
available anytime we use `npm install`
- now we can set up scalingo to not install devDeps while still
succeeding in installing the project. Actually, following their docs,
scalingo shouldn't install devDeps by default but it actually does. We
should be able to use an env var to force it bypassing devDeps
(Scalingo/nodejs-buildpack#89)
manuhabitela added a commit to numerique-gouv/moncomptepro that referenced this issue Mar 20, 2024
- on deploy (on scalingo), the project is built. So it uses the build
scripts using concurrently, vite and all. We make sure those deps are
available anytime we use `npm install`
- now we can set up scalingo to not install devDeps while still
succeeding in installing the project. Actually, following their docs,
scalingo shouldn't install devDeps by default but it actually does. We
should be able to use an env var to force it bypassing devDeps
(Scalingo/nodejs-buildpack#89)
@Frzk Frzk self-assigned this Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants