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

[BUG] npm install does not run prepare script for local file dependencies #459

Closed
HosseinAgha opened this issue Nov 10, 2019 · 4 comments
Closed
Labels
Bug thing that needs fixing

Comments

@HosseinAgha
Copy link

HosseinAgha commented Nov 10, 2019

What / Why

Imagine I have package-a that depends on the package-b using the file specifier.
For example we have this dependency line in the package.json of package-a:

"name": "package-a",
"dependencies": {
   "package-b": "file:../package-b"
}

How

Current Behavior

If I run npm install in package-a then npm correctly installs package-b dependencies.
But it only runs preinstall and postinstall scripts and ignores prepare script.
If I run npm install directly in package-b then it successfully runs the prepare script.

Expected Behavior

It should run prepare script for local dependencies (package-b) like it would for github dependencies. This gets very confusing for npm users as npm install would run inconsistent scripts for different dependency types.

References

I think #321 is related but it seems fixed in the latest version.

npm version

I use node v12.13.0 and npm 6.13.0

@qrosmeli
Copy link

The same thing is happening to me. I also tried to install package-b in another project (npm install "../folder/package-a/package-b") and I got the same result: package is installed, but no prepare or prepublish script ran. Is this an expected behavior?

I have node v10.16.0 and npm v6.9.0.

@shrinktofit
Copy link

Any updates?

@darcyclarke
Copy link
Contributor

npm v6 is no longer in active development; We will continue to push security releases to v6 at our team's discretion as-per our Support Policy.

If your bug is preproducible on v7, please re-file this issue using our new issue template.

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.

1 similar comment
@darcyclarke
Copy link
Contributor

npm v6 is no longer in active development; We will continue to push security releases to v6 at our team's discretion as-per our Support Policy.

If your bug is preproducible on v7, please re-file this issue using our new issue template.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing
Projects
None yet
Development

No branches or pull requests

4 participants