fix(git): git repos with prepare scripts always install with dev flag #17060
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for finding this!
lib/pack.js
Outdated
@@ -163,6 +163,7 @@ function packGitDep (manifest, dir) { | |||
const child = cp.spawn(process.env.NODE || process.execPath, [ | |||
require.main.filename, | |||
'install', | |||
'--only=dev', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will only install devDependencies
and not dependencies
. Did you want to use --dev
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did originally have --dev
but when I used it locally it told me that it's deprecated and that i should be using --only=dev
so I assumed the name was misleading :)
Guess not and will revert back to --dev
Addressed comments :) (not sure if you get a notification for that) |
@@ -163,6 +163,7 @@ function packGitDep (manifest, dir) { | |||
const child = cp.spawn(process.env.NODE || process.execPath, [ | |||
require.main.filename, | |||
'install', | |||
'--dev', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there should be a --prod
here as well to protect us against users who were doing an --only=dev
install previously.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM and solved :)
accc885
to
ebf1927
Compare
Force devDependencies to always install with --dev flag in case NODE_ENV is production
Related: #16533
Closes #17059