-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[BUG] When installing a git dependency, prepare script can see dev dependencies, prepack script can not #1229
Comments
In my case, a git dependency of my project has this in package.json: "scripts": {
"build": "gulp copyAssets && npm run compile"
"prepack": "npm run build"
// ...
},
"devDependencies": {
"gulp": "^4.0.2",
"gulp-cli": "^2.2.0",
// ...
} and when my project is installing this dependency, it fails with output like this:
However when I fork that dependency and make it use "scripts": {
"build": "gulp copyAssets && npm run compile"
"prepare": "npm run build" // <-------------- HERE
// ...
},
"devDependencies": {
"gulp": "^4.0.2",
"gulp-cli": "^2.2.0",
// ...
} then everything works perfectly. |
This bit me again. It's a tricky problem because some alternative tools to NPM only support This means if we have This makes it difficult to make packages consumable from git while being compatible with all tools in the ecosystem. Would it be fine to add dev dependency support to |
Hellooooooooooooooooo. Does anyone triage NPM issues? |
@trusktr Which version of npm CLI are you using? EDIT: My bad, the way I confirmed the behavior was not correct. v6.14.8
v7.0.0-beta.12
|
Are there any work arounds or should we just avoid npm v7 if we're using git installs? Currently everything I try to use is failing because devDeps are missing. Using |
npm If your bug is preproducible on If your issue was a feature request, please consider opening a new RRFC or RFC. If your issue was a question or other idea that was not CLI-specific, consider opening a discussion on our feedback repo Closing: This is an automated message. |
What
When a project has a dependency from git that has a
prepack
script (instead of aprepare
script), theprepack
step of the git dependency fails because dev dependencies are not present to theprepack
script.This issue is not happening if the git dependencies use
prepare
instead ofprepack
.When
Whenever I run
npm install
in my project, and the git dependencies have aprepack
script instead of aprepare
script.Where
Git dependencies. I haven't made a public reproduction yet.
How
Publish a package in a git repo. Make sure it uses
prepack
in its package.json to define the steps needed to build the projects into usable state.Current Behavior
My project's
npm install
fails because a git dependency'sprepack
script fails to find the commands that it uses.If I fork the git dependency and modify it to use
prepare
, then things work great.Steps to Reproduce
prepack
to run the steps needed to build it (f.e. build fromsrc/
todist/
). Make sure thisprepack
script relies on executables installed as dev dependencies.npm install
in the project that depends on the git dependency.prepack
step in the git dependency should fail.Expected Behavior
prepack
should work the same asprepare
in this regard.Who
Me, but hopefully I'm not the only one!
The text was updated successfully, but these errors were encountered: