Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

Don't run npm update in Heroku postbuild task #287

Merged
merged 1 commit into from
Apr 12, 2022
Merged

Conversation

ivomurrell
Copy link
Contributor

heroku-postbuild is a task that is typically called via a heroku-postbuild script in the project's package.json, which will be called during a Heroku build after the main build script has run. One command in the task is npm update. Since npm 8.3.2, this command will now automatically prune dev dependencies if running in a production Node environment (it's unclear if this was a conscious change.) This means that subsequent steps in the task fail as n-gage has been pruned prematurely.

I don't think we really want to be running npm update after we've build the Heroku app anyway, especially now that we have lockfiles in most projects.

heroku-postbuild is a task that is typically called via a
`heroku-postbuild` script in the project's `package.json`, which will be
called during a Heroku build after the main build script has run. One
command in the task is `npm update`. Since npm 8.3.2, this command will
now automatically prune dev dependencies if running in a production Node
environment (it's unclear if this was a conscious change.) This means
that subsequent steps in the task fail as n-gage has been pruned
prematurely.

I don't think we really want to be running `npm update` after we've
build the Heroku app anyway, especially now that we have lockfiles in
most projects.
@ivomurrell ivomurrell requested a review from a team as a code owner April 12, 2022 12:02
@ivomurrell ivomurrell merged commit 1ae4a94 into main Apr 12, 2022
@ivomurrell ivomurrell deleted the fix-heroku-pruning branch April 12, 2022 13:31
This was referenced Apr 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants