React: Bug: Installation error on npx create-react-app my-app

Created on 25 Apr 2020  路  7Comments  路  Source: facebook/react

node version : 12.16.2
npm version: 6.14.4
os: Windows 10

while creating new app with this cl npx create-react-app my-app gives this error

PS D:> npx create-react-app my-app
npx: installed 99 in 16.418s
Must use import to load ES Module: C:\Users\Nexus\AppData\Roaming\npm-cache_npx\16380\node_modules\create-react-app\node_modules\is-promise\index.js
require() of ES modules is not supported.
require() of C:\Users\Nexus\AppData\Roaming\npm-cache_npx\16380\node_modules\create-react-app\node_modules\is-promise\index.js from C:\Users\Nexus\AppData\Roaming\npm-cache_npx\16380\node_modules\create-react-app\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\Nexus\AppData\Roaming\npm-cache_npx\16380\node_modules\create-react-app\node_modules\is-promise\index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from C:\Users\Nexus\AppData\Roaming\npm-cache_npx\16380\node_modules\create-react-app\node_modules\is-promisepackage.json.

when creating new next app with npx create-next-app it successfully install

what is the problem

Unconfirmed

Most helpful comment

@Arleyrock7 this was 3rd party code but the issue is now resolve

All 7 comments

I'm experiencing the same issue.

The issue here is with is-promise a core package on alot of frameworks pushed out a dodgy update in last hour
https://github.com/then/is-promise/pull/15 is the PR to fix apparently and here the bug to tack https://github.com/then/is-promise/issues/12

this has also broken angular and many others. all because developers used a package for this :

function isPromise(obj) {
  return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
}

@neupaneanish this is confirmed but 3rd party

I have the same issue! Could someone solve it?

@Arleyrock7 this was 3rd party code but the issue is now resolve

It's working for me now. Thx.

yes its third party error and it solved

Was this page helpful?
0 / 5 - 0 ratings