-
Notifications
You must be signed in to change notification settings - Fork 17
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
Always overriding NODE_ENV with development #691
Comments
Hey @MilosMoravac , did you find any workaround for this issue ? |
The original reason for this seems that the dev_dependencies should be available for the other buildpacks during build (see comment). Overwriting the user input feels wrong. |
After digging a bit deeper into the code, I don't think the problem is Line 159 in ae17688
but rather Line 131 in ae17688
which will call npm-install/install_build_process.go Line 49 in ae17688
The "problem" is that this is by intention. It will always install the |
So in our pipeline when we build the image using packeto we set |
@MilosMoravac Even I tried explicitly setting the NODE_ENV="production" but still during the build time it is building with NODE_ENV as "development". Could you please share the command and logs which made you get the production NODE_ENV ? We are stuck with this blocker for a really long time and would really like a solution/workaround for this. |
Yeah this is biting us as well. We've had to restort to doing this in our package.json files:
|
Sorry for late reply, we added |
Expected Behavior
When NODE_ENV is specified it should override development and not the other way around.
Current Behavior
Whatever is set during build environment install process it will be overridden to development
Possible Solution
Steps to Reproduce
Configuring build environment NODE_ENV -> "development" PATH -> "$PATH:/layers/paketo-buildpacks_npm-install/build-modules/node_modules/.bin"
Motivations
First of all I am a devops so this isn't really my cup of tea. So this is an issue my team has run into while using vite where the front builds and its throwing them errors. Whatever we do in nginx.toml it still uses the
NODE_ENV=development
. In the buildpack source code I found an override that always overwrites the variable you set with development I could be wrong but don't have many ideas left. I've tried locally to append env variable to 'pack build ' using--env
but it does nothing.This is the line of code I am suspecting is the issue.
layer.BuildEnv.Override("NODE_ENV", "development")
located herenpm-install/build.go
Line 159 in 7b388f0
The text was updated successfully, but these errors were encountered: