-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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] Prepare script not running #2890
Comments
Dev deps should only be installed when running |
That's not what I understand from the documentation Also, even if a step 3a |
ah, fair enough. |
what is your prepare script doing? it's very likely it's running and we're just suppressing the output. one of the major changes in npm 7 is that we no longer display the results of lifecycle scripts at installation time in an attempt to reduce noise. if, however, your prepare script is doing work like creating or modifying files and that modification isn't taking place, if you can give us a reproduction case with a real repo that would help a lot in addressing this for you. |
It's running This is only happening in a private repo. Should I create one for testing purposes and invite you? |
Hi @nlf. I've encountered this bug as well, when using tarball dependencies. I've also created a repository to reproduce the issue: https://github.com/sxn/prepare-repro |
This needs a bit more investigation our end; Potentially this is intentional but prioritizing accordingly (seems like v6 was doing this) |
Any updates on this end? It'd be better to not have to downgrade to v6 for this feature. |
Confirmed this is 100% an issue #3800 This was also an issue in v6 #3800 (comment) |
hi @tejohnso thanks for taking the time to let us know about this issue 😊 I believe this issue has been fixed since then and it should no longer be the case in @sxn thanks for that repro, it was very useful while validating that everything is working as intended! it turns out that using full URLs like that So in short npm needs to be aware the install is coming from a git repo in order to run prepare scripts. If you provide the full path to a remote tarball such as I'm going to close this issue since everything is working as expecting as of Thanks everyone! |
@ruyadorno I don't see anything in the 8.5.2 release that would have fixed the issue and I'm still seeing it happen on 8.5.1. My dependency is of the form |
hi @tejohnso sorry to hear, in this case I'd ask you to please open a new issue providing much more info / details about your project setup and the repo you're trying to install. Ideally we need to reduce the bug to a minimal reproduction (an empty project with just a git repo dependency demonstrating the problem, similar to what @sxn did in this thread) in order to find out what the problem really is. |
There's nothing special about the repo. I just set one up with npm init as described in the issue detail. I'll see if the same thing happens with a public repo, in which case I can save you the trouble of creating a repo to reproduce the issue. |
@ruyadorno Maybe my expectations are off. From the documentation I see
From this I expect that if A has dependency B, and dependency B has a prepare script in it, then But later in the documentation, there's a new section that indicates "These are run from the scripts of <pkg-name>" and Can you clarify whether dependency Bs prepare script is supposed to run from an |
Why this issue is closed? I found no way to execute |
I've searched a number of issues related to
prepare
but could not find quite the same scenario.Current Behavior:
npm install
does not run prepare script and does not install devDependenciesExpected Behavior:
npm install
should run prepare script and install devDependenciesSteps To Reproduce:
npm init -y
in a local test foldernpm install git+ssh://[email protected]:ghname/ghrepo#semver:^0.0.0
Environment:
OS: Arch Linux
NPM: 7.6.3
NODE: 15.11.0
The text was updated successfully, but these errors were encountered: