Giter VIP home page Giter VIP logo

Comments (13)

hyrumwhite avatar hyrumwhite commented on August 28, 2024 3

These all run after the actual installation of modules into node_modules, in order, with no internal actions happening in between

What's the point of any of the lifecycle hooks, besides postinstall, if they all run after install without doing anything in between?

from cli.

Kuinox avatar Kuinox commented on August 28, 2024 2

@trevor-scheer due to this bug we switched to yarn and it works without any issue.
They also answered the issues I opened, in less than one week :D.

from cli.

trevor-scheer avatar trevor-scheer commented on August 28, 2024 2

Can confirm the two are consistent now, at least in our case where a dependency is missing. The preinstall script doesn't run in either case now if the installation of node_modules fails. Totally unnecessary to clone and run this repo, but if you choose to, you can note the preinstall.js script never runs (logging "hello") in either case of npm i or npm ci. This is not the case in npm@6.
https://github.com/trevor-scheer/npm-preinstall-reproduction

This is documented clearly under npm ci, but not under npm install.

from cli.

Kuinox avatar Kuinox commented on August 28, 2024

Now some package cannot even be installed using npm ci because the library author does not use npm ci and this bug break the package install.
We cannot use npm ci on some of our project because of this.

from cli.

Kuinox avatar Kuinox commented on August 28, 2024

I believe these issues are the same bug: #454 & #452 .

from cli.

robertaistleitner avatar robertaistleitner commented on August 28, 2024

Same here, I do some clean-up (including node_modules) on preinstall in development with npm install. In our CI pipeline this is done via npm ci which installs the dependencies, after that preinstall is deleting the node_modules folder because of the wrong execution order.

from cli.

maboesanman avatar maboesanman commented on August 28, 2024

I'm also having this issue. I'm using npm install <folder> to use my package in my integration tests, and that folder needs to be built before I run install. for now I'm just manually building it but I would like preinstall to handle this, or at least for there to be a "predownload" script or something

from cli.

trevor-scheer avatar trevor-scheer commented on August 28, 2024

We have a similar use case. We're building a package from rust to create a wasm/js package, which we'd like to then install via a file reference. With npm ci, this build step doesn't happen until the error of a missing package has already failed the install.

from cli.

trevor-scheer avatar trevor-scheer commented on August 28, 2024

Sadly not an option for us but thanks for the quick response @Kuinox! Glad you found a way around it πŸ™‚

from cli.

darcyclarke avatar darcyclarke commented on August 28, 2024

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.

from cli.

Kuinox avatar Kuinox commented on August 28, 2024

πŸŽ‰this bug got automatically closed for the second time.

from cli.

ljharb avatar ljharb commented on August 28, 2024

@Kuinox can you confirm that this is still an issue in npm 7?

from cli.

Kuinox avatar Kuinox commented on August 28, 2024

I can't, because I don't remember which conditions caused this issue.

from cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.