I'm trying to create a new React app using create-react-app and it in every way it just don't work. it throws the following error:
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: C:\Users\DevCarlosU\Desktop\test-final\node_modules\is-promise\index.js
No, it's for a new project.
Environment Info:
current version of create-react-app: 3.4.1
running from C:\Users\DevCarlosUAppData\Roaming\npm\node_modules\create-react-app
System:
OS: Windows 10 10.0.18362
CPU: (8) x64 Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
Binaries:
Node: 12.16.2 - C:\Program Files\nodejs\node.EXE
Yarn: Not Found
npm: 6.14.4 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: 44.18362.449.0
Internet Explorer: 11.0.18362.1
npmPackages:
react: Not Found
react-dom: Not Found
react-scripts: Not Found
npmGlobalPackages:
create-react-app: Not Found
(Write your steps here:)
A new and clean React App project
PS C:\Users\DevCarlosU\Desktop> npx create-react-app test
Creating a new React app in C:\Users\DevCarlosU\Desktop\test.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
[email protected] postinstall C:\Users\DevCarlosU\Desktop\test\node_modules\babel-runtime\node_modules\core-js
node -e "try{require('./postinstall')}catch(e){}"
[email protected] postinstall C:\Users\DevCarlosU\Desktop\test\node_modules\core-js
node -e "try{require('./postinstall')}catch(e){}"
[email protected] postinstall C:\Users\DevCarlosU\Desktop\test\node_modules\core-js-pure
node -e "try{require('./postinstall')}catch(e){}"
58 packages are looking for funding
run npm fund
for details
found 0 vulnerabilities
internal/modules/cjs/loader.js:1172
throw new ERR_REQUIRE_ESM(filename, parentPath, packageJsonPath);
^
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: C:\Users\DevCarlosU\Desktop\test\node_modules\is-promise\index.js
require() of ES modules is not supported.
require() of C:\Users\DevCarlosU\Desktop\test\node_modules\is-promise\index.js from C:\Users\DevCarlosU\Desktop\test\node_modules\run-async\index.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename C:\Users\DevCarlosU\Desktop\test\node_modules\is-promise\index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from C:\Users\DevCarlosU\Desktop\test\node_modules\is-promise\package.json.
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1172:13)
at Module.load (internal/modules/cjs/loader.js:1000:32)
at Function.Module._load (internal/modules/cjs/loader.js:899:14)
at Module.require (internal/modules/cjs/loader.js:1042:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous> (C:\Users\DevCarlosU\Desktop\test\node_modules\run-async\index.js:3:17)
at Module._compile (internal/modules/cjs/loader.js:1156:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10)
at Module.load (internal/modules/cjs/loader.js:1000:32)
at Function.Module._load (internal/modules/cjs/loader.js:899:14) {
code: 'ERR_REQUIRE_ESM'
}
Aborting installation.
node has failed.
Deleting generated file... node_modules
Deleting generated file... package.json
Done.
(Paste the link to an example project and exact instructions to reproduce the issue.)
Issue is related to is-promise and tracked here https://github.com/then/is-promise/issues/14
I have the exact same problem and exact same environment. Please someone help!
I have the same issue, i tried all possible ways
npx create-react-app
yarn create react-app
create-react-app
all are throwing same error
i have node (12.16.2), npm (6.14.4), yarn (1.21.1).
Having the same issue as @sudir81
having the same issue
Having the same issue
having the same issue when run image in docker
Workaround here: https://github.com/facebook/create-react-app/issues/8896#issuecomment-619406384
I've downgraded to node 12.11.1 and it works!!
@RyanZim Works for me TKS!
Same problem
Downgrading fixed it!!!
Same issue here.
Workaround here: #8896 (comment)
Solved!!!
i have the same issue when generate new page in ionic 4 angular project
Downgrade fix it!
1.- npm install -g n
2.- n 12.12.0
3.- npx create-react-app react-sample
That was what I did!
i too.
i'll down for 12.12.0 with nodist
Yeah, downgrade to 12.12.0 works! Thanks a lot...
I had the same issue with quasar-cli, as I downgraded to 12.12.0 it worked, thanks.
Simply running npm install is-promise
fixed it for me
@SenTisso tks, it's fixed for me
Simply running
npm install is-promise
fixed it for me
Duplicate of #8896, which should be resolved now.
Downgrade @babel/runtime to 7.7.2 fixed it for me.
https://github.com/standard-things/esm/issues/868#issuecomment-587151825
Most helpful comment
I've downgraded to node 12.11.1 and it works!!