Closed ngeojiajun closed 2 years ago
I think I just ran into this same issue, the error I saw was:
➜ fission git:(main) wnfs-migration
/Users/jeff/code/node/globals/node_modules/native-fetch/src/index.js:12
default: require('node-fetch').default,
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/jeff/code/node/globals/node_modules/node-fetch/src/index.js from /Users/jeff/code/node/globals/node_modules/native-fetch/src/index.js not supported.
Instead change the require of /Users/jeff/code/node/globals/node_modules/node-fetch/src/index.js in /Users/jeff/code/node/globals/node_modules/native-fetch/src/index.js to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (/Users/jeff/code/node/globals/node_modules/native-fetch/src/index.js:12:14)
at Object.<anonymous> (/Users/jeff/code/node/globals/node_modules/ipfs-utils/src/fetch.js:9:20)
at Object.<anonymous> (/Users/jeff/code/node/globals/node_modules/ipfs-utils/src/http/fetch.node.js:2:62)
at Object.<anonymous> (/Users/jeff/code/node/globals/node_modules/ipfs-utils/src/http/fetch.js:8:20)
at Object.<anonymous> (/Users/jeff/code/node/globals/node_modules/ipfs-utils/src/http.js:4:37)
at async Promise.all (index 0) {
code: 'ERR_REQUIRE_ESM'
}
Thanks! Fixed in 2.0.4
Summary
npm install wnfs-migration
install the wrong version of thenode-fetch
due.Problem
The
package.json
of the indirect dependency of thewnfs-migration
specifies the direct url instead of the version instead. This results in the npm to instead install the lastest version of thenode-fetch
rather than download and install the package on the provided url.Impact
wnfs-migration
command will fail to execute due to the breaking changes to it which have prevented the CommonJS stylerequire('node-fetch')
from working.Solution
The possible solution that are found is to manually perform the installation of the said package
Detail
To Reproduce Install the package through the command
npm install wnfs-migration
then run thewnfs-migration
Expected behavior The application should starts up
Desktop (please complete the following information):