Custom node-fetch causes builds to fail #158
Labels
kind/bug
A bug in existing code (including security flaws)
status/blocked
Unable to be worked further until needs are met
Recently we removed the
ipfs
dependency in our repository to opt-in for the lightweightipfs-core
package for our tests. Our repository already hasnode-fetch
package and following the installation ofipfs-core@0.12.2
and subsequentlyipfs-utils@9.0.2
our builds started to fail.The reason seems to be the custom node package used in this repo:
node-fetch@npm:@achingbrain/node-fetch@2.6.7
. Our othernode-fetch
packages had@^2.6.x
and since the latest official package is2.6.6
the custom@acingbrain/node-fetch@2.6.7
overrides others.We get the following error in our builds.
Reproducing
To reproduce follow these steps.
Our builds are on CircleCI. Spin up the CircleCI node container
In the container terminal cd into circleci folder
Clone the repository and cd
Checkout the relevant commit. (See the branch on GitHub )
Install dependencies
Note that
--ci
flag is used. This is automatically detected in the CircleCI build environment. Local installs without this flag will not fail.Fix
I was able to fix the issue by setting the
node-fetch@^2.6.1
on our repo to fixednode-fetch@2.6.6.
Then removing thepackage-lock.json
files and running annpm install
.This results with two different
node-fetch
modules being used as intended:A better way to handle this would be to name the custom
node-fetch
in this repo with an alias so that it does not interfere with othernode-fetch
versions.The text was updated successfully, but these errors were encountered: