I need to get node-fetch working for a VUE JS project but I ran into these dependencies errors:
These dependencies were not found:
* node:buffer in ./node_modules/node-fetch/src/index.js, ./node_modules/node-fetch/src/body.js
* node:http in ./node_modules/node-fetch/src/index.js, ./node_modules/node-fetch/src/headers.js
* node:https in ./node_modules/node-fetch/src/index.js
* node:net in ./node_modules/node-fetch/src/utils/referrer.js
* node:stream in ./node_modules/node-fetch/src/index.js, ./node_modules/node-fetch/src/body.js
* node:url in ./node_modules/node-fetch/src/request.js
* node:util in ./node_modules/node-fetch/src/body.js, ./node_modules/node-fetch/src/headers.js and 1 other
* node:zlib in ./node_modules/node-fetch/src/index.js
To install them, you can run: npm install --save node:buffer node:http node:https node:net node:stream node:url node:util node:zlib
I tried to run npm install --save node:buffer node:http node:https node:net node:stream node:url node:util node:zlib
but got this error:
npm ERR! code EUNSUPPORTEDPROTOCOL npm ERR! Unsupported URL Type "node:": node:buffer
How to install the missing dependencies?
(I'm using NODE JS v16.13.2 on UBUNTU 18.04.6 LTS)
node:
protocol prefix for built-in modules was added to nodejs v16.0.0 and v14.18.0. I'd suggest you make absolutely sure that you're really running the nodejs v16.13.2 that you think you are because the error makes it sound like you're actually running an older version of node. You could probably also get a slightly older version ofnode-fetch
that doesn't use those prefixes. – Carlson