JoinColony / colonyNetwork

Colony Network smart contracts
https://colony.io/
GNU General Public License v3.0
438 stars 106 forks source link

Exploration of PNPM #1249

Closed area closed 3 months ago

area commented 3 months ago

For whatever reason - possibly with the move to Node 20 - we're having real issues with a single lockfile being installable on Linux and OSX. This comes down to fsevents being only needed on OSX (and therefore optional elsewhere) and npm having an issue with that - see https://github.com/npm/cli/issues/4828 for the ongoing issue related to this.

I've explored what it would look like if we moved to pnpm. As well as the lockfile issue being resolved (I think), a couple of nice side benefits:

npm i -g pnpm@8 to install, and then just use pnpm instead of npm to call everything is all that should be necessary.

~NB based on top of maint/docker-file-builds.~

area commented 3 months ago

As an addendum, after speaking to Chris, the resident Node guru:

kronosapiens commented 3 months ago

I've been dealing with this issue for a while (~3 months) when we were on node@14. I went down a few rabbit holes, but the only fix which consistently worked in CI was manually editing package-lock.json to add "linux" to the os field:

      "os": [
        "darwin",
        "linux" // Manually add this
      ],

This behavior could conceivably be incorporated into a post-commit hook using sed.

area commented 3 months ago

Don't want this merged yet (requires https://github.com/JoinColony/colonyCDapp/pull/2316), but interested in a review.

area commented 3 months ago

The versioning check script is broken, but not as a result of this PR so don't intend for it to hold it up.