0

How would you import a specific version of a node module? I know in npm you can do npm i someModule@1.0.0 But whats not what I'm looking for. I so far I have like this:

// File 1
const fetch = require('node-fetch@2.6.6');

// File 2
const fetch = require('node-fetch@3.1.0');

Any help would be appreciated. Thank you.

K.K Designs
  • 688
  • 1
  • 6
  • 22
  • 1
    https://stackoverflow.com/questions/26414587/how-to-install-multiple-versions-of-package-using-npm – szulbix Jan 15 '22 at 21:57

1 Answers1

0

I found my answer here. Thank you @szulbix for sending me this.

I ran npm i node-fetch-commonjs@npm:node-fetch@2.6.6 and then imported using

const fetch = require('node-fetch-commonjs');

I hoped this helped other people who come across this thread!

K.K Designs
  • 688
  • 1
  • 6
  • 22