NPM Error [ERR_REQUIRE_ESM] solution for node-fetch

Publicado el: 01 enero 1970
en el canal de: Agnim plays
1,292
6

NODE PACKAGE Manager --- Error [ERR_REQUIRE_ESM]:
Issue with node-fetch install , require() not working

Solution:

Step 1: open package.json and modify as follows (Add "type": "module")


{
"type": "module",
"dependencies": {
"node-fetch": "^3.1.0"
}
}


Step 2: change 1st line from const fetch = require('node-fetch'); to import fetch from 'node-fetch';


Step 3: now run again in terminal npm install node-fetch.


En esta página del sitio puede ver el video en línea NPM Error [ERR_REQUIRE_ESM] solution for node-fetch de Duración hora minuto segunda en buena calidad , que subió el usuario Agnim plays 01 enero 1970, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 1,292 veces y le gustó 6 a los espectadores. Disfruta viendo!