Closed akctba closed 4 years ago
@sabinlungudotcpp You need to install nvm to use that command
Yeah, or I can just go on the node website and download it from there I guess.
working as expected with node version 12.12.0
working as expected with node version 12.12.0
So docker run -it -p 3000:3000
I had the same problem.
I uninstalled the current node and installed version 12.12.0
Follow the link: https://nodejs.org/dist/v12.12.0/
hi im Raahul, i tried to create React app using npx, suddenly facing this error can anyone pls help me to solve this, internal/modules/cjs/loader.js:616 if (e.code !== 'ERR_PACKAGE_PATH_NOT_EXPORTED') throw e; ^
Error [ERR_INVALID_PACKAGE_TARGET]: Invalid "exports" main target "index.js" defined in the package config /C:/Users/v-sotb/node_modules/is-promise\package.json
at resolveExportsTarget (internal/modules/cjs/loader.js:574:13)
at resolveExportsTarget (internal/modules/cjs/loader.js:613:20)
at applyExports (internal/modules/cjs/loader.js:503:14)
at resolveExports (internal/modules/cjs/loader.js:541:12)
at Function.Module._findPath (internal/modules/cjs/loader.js:661:22)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:963:27)
at Function.Module._load (internal/modules/cjs/loader.js:859:27)
at Module.require (internal/modules/cjs/loader.js:1036:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.
sabin@Sabins-MacBook-Pro frontend % docker run -p 3000:3000 4cf7ec1d68cc
Can anyone help me out here? I am using node version 12.12.0 and still getting this error?
frontend@0.1.0 start /app react-scripts start
internal/modules/cjs/loader.js:584 if (e.code !== 'ERR_PACKAGE_PATH_NOT_EXPORTED') throw e; ^
Error [ERR_INVALID_PACKAGE_TARGET]: Invalid "exports" main target "index.js" defined in the package config /app/node_modules/is-promise/package.json
at resolveExportsTarget (internal/modules/cjs/loader.js:542:13)
at resolveExportsTarget (internal/modules/cjs/loader.js:581:20)
at applyExports (internal/modules/cjs/loader.js:455:14)
at resolveExports (internal/modules/cjs/loader.js:508:23)
at Function.Module._findPath (internal/modules/cjs/loader.js:632:31)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1001:27)
at Function.Module._load (internal/modules/cjs/loader.js:884:27)
at Module.require (internal/modules/cjs/loader.js:1074:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.react-scripts start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the frontend@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2020-04-25T17_15_39_404Z-debug.log sabin@Sabins-MacBook-Pro frontend % .
hi im Raahul, i tried to create React app using npx, suddenly facing this error can anyone pls help me to solve this, internal/modules/cjs/loader.js:616 if (e.code !== 'ERR_PACKAGE_PATH_NOT_EXPORTED') throw e; ^
Error [ERR_INVALID_PACKAGE_TARGET]: Invalid "exports" main target "index.js" defined in the package config /C:/Users/v-sotb/node_modules/is-promise\package.json at resolveExportsTarget (internal/modules/cjs/loader.js:574:13) at resolveExportsTarget (internal/modules/cjs/loader.js:613:20) at applyExports (internal/modules/cjs/loader.js:503:14) at resolveExports (internal/modules/cjs/loader.js:541:12) at Function.Module._findPath (internal/modules/cjs/loader.js:661:22) at Function.Module._resolveFilename (internal/modules/cjs/loader.js:963:27) at Function.Module._load (internal/modules/cjs/loader.js:859:27) at Module.require (internal/modules/cjs/loader.js:1036:19) at require (internal/modules/cjs/helpers.js:72:18) at Object. (C:\Users\v-sotb\node_modules\run-async\index.js:3:17) { code: 'ERR_INVALID_PACKAGE_TARGET' }
I think some NodeJS dependencies got messed up and for some reason, we are getting this error..
hi im Raahul, i tried to create React app using npx, suddenly facing this error can anyone pls help me to solve this, internal/modules/cjs/loader.js:616 if (e.code !== 'ERR_PACKAGE_PATH_NOT_EXPORTED') throw e; ^ Error [ERR_INVALID_PACKAGE_TARGET]: Invalid "exports" main target "index.js" defined in the package config /C:/Users/v-sotb/node_modules/is-promise\package.json at resolveExportsTarget (internal/modules/cjs/loader.js:574:13) at resolveExportsTarget (internal/modules/cjs/loader.js:613:20) at applyExports (internal/modules/cjs/loader.js:503:14) at resolveExports (internal/modules/cjs/loader.js:541:12) at Function.Module._findPath (internal/modules/cjs/loader.js:661:22) at Function.Module._resolveFilename (internal/modules/cjs/loader.js:963:27) at Function.Module._load (internal/modules/cjs/loader.js:859:27) at Module.require (internal/modules/cjs/loader.js:1036:19) at require (internal/modules/cjs/helpers.js:72:18) at Object. (C:\Users\v-sotb\node_modules\run-async\index.js:3:17) { code: 'ERR_INVALID_PACKAGE_TARGET' }
I think some NodeJS dependencies got messed up and for some reason, we are getting this error..
yeah i think so....never face this error before :(
@sabinlungudotcpp @Raahul5 Currently a Node dependency broke (https://github.com/then/is-promise/pull/15) and they're working on it. For now, the idea is to somehow downgrade that dependency to the last working version. You can try downgrade the problematic dependency by itself to v2.1.0 as mentioned here: https://github.com/then/is-promise/issues/14#issuecomment-619400516
$ npm install is-promise@2.1.0
If that doesn't work, downgrade the whole thing (Node) to its last working version. Node v12.12.0 and its included dependencies works for me.
$ n 12.12.0
$ npx create-react-app react-sample
Edited for clarity.
I downgraded Node to 12.12.0 and everything works fine, so Node has been screwed up recently
Doesn't work for me.
@sabinlungudotcpp @Raahul5 Currently a Node dependency broke (then/is-promise#15) and they're working on it. For now, the idea is to somehow downgrade that dependency to the last working version. Node 12.12.0 works for me.
$ n 12.12.0
$ npx create-react-app react-sample
if that doesn't work, you can try downgrade the problematic dependency to 2.1.0 as mentioned here: then/is-promise#14 (comment)
$ npm install is-promise@2.1.0
Still doesn't work. I still get the error I posted above.
Install NVM using this link then use that to install version 12.12.0. It worked for me. The instruction is clear
Same here
@sabinlungudotcpp @Raahul5 Currently a Node dependency broke (then/is-promise#15) and they're working on it. For now, the idea is to somehow downgrade that dependency to the last working version. Node 12.12.0 and its included dependencies works for me.
$ n 12.12.0
$ npx create-react-app react-sample
if that doesn't work, you can try downgrade the problematic dependency by itself to 2.1.0 as mentioned here: then/is-promise#14 (comment)
$ npm install is-promise@2.1.0
still not work can't create app
If you are on NPM, run: npm install is-promise@2.1.0 --save --save-exact
npm uninstall create-react-app npm uninstall -g create-react-app npm install -g create-react-app@1.5.2 create-react-app --help //to check if installed correctly, should return the help info create-react-app confusion --scripts-version=react-scripts@1.1.4 cd confusion npm start
This creates the app but unable to do yarn start or npm start
This should be fixed now that https://github.com/then/is-promise/pull/15 is merged. :)
the author of is-promise
has resolved the issue: https://github.com/then/is-promise/issues/14#issuecomment-619417917
it should work if you reinstall create-react-app
if you have a global install, or use npx create-react-app
(this same issue impacted expo-cli
and i confirmed it there too)
It is also happening while trying to start an app, downgrading Node to 12.12.0 solved the issue.
npm uninstall create-react-app npm uninstall -g create-react-app npm install -g create-react-app@1.5.2 create-react-app --help //to check if installed correctly, should return the help info create-react-app confusion --scripts-version=react-scripts@1.1.4 cd confusion npm start
This creates the app but unable to do yarn start or npm start
For Npm start and yarn start install npm install is-promise@2.2.2 --save --save-exact
This resolved the issue for me I'm on Node v14 latest one // resolved the must use import to load Es module //
Fixed for me
If you are on NPM, run: npm install is-promise@2.1.0 --save --save-exact
thanx #mark its work own app created :)
npm uninstall create-react-app npm uninstall -g create-react-app npm install -g create-react-app@1.5.2 create-react-app --help //to check if installed correctly, should return the help info create-react-app confusion --scripts-version=react-scripts@1.1.4 cd confusion npm start
This creates the app but unable to do yarn start or npm start
For Npm start and yarn start install npm install is-promise@2.1.0 --save --save-exact
This resolved the issue for me I'm on Node v14 latest one // resolved the must use import to load Es module //
Fixed for me
Thanks Man This worked for me.
They fixed the issue, npx create-react-app should be working normal again.
I was trying it for the last two hours on Mac instead of my windows machine. I thought that was the issue. Turns out it was just a problem with npm for the last few hours 🤦 ...
@DEATRYDE thx bro, your way worked for me too. Great Work
It’s fixed see https://github.com/then/is-promise/issues/20
if you just want to create react app, you can do this while waiting for a fix: step 1:
yarn init -y
step 2: Insert this to package.json"resolutions": { "is-promise": "2.1.0", "run-async/is-promise": "2.1.0" }
step 3:
yarn add --dev create-react-app
step 4:node node_modules/create-react-app/createReactApp.js ../my-app
this one worked for me
worked for me as well
I am having this issue as well
Gracias, me funciono también con node v12.16. Solo que instale npm install is-promise@2.2.2 --save --save-exact
This should be resolved now. As @brentvatne mentioned above, if you have create-react-app
installed globally, uninstalling then reinstalling should fix it. Otherwise, npx create-react-app
or yarn dlx create-react-app
always uses the latest version.
The npx command is aborting and doesn't create the application.
I'm using the command: npx create-react-app appexample
and at the end of the execution it prints:
Error [ERR_INVALID_PACKAGE_TARGET]: Invalid "exports" main target "index.js" defined in the package config /Users/alexkayser/git/apptest/node_modules/is-promise/package.json at resolveExportsTarget (internal/modules/cjs/loader.js:542:13) at resolveExportsTarget (internal/modules/cjs/loader.js:581:20) at applyExports (internal/modules/cjs/loader.js:455:14) at resolveExports (internal/modules/cjs/loader.js:508:23) at Function.Module._findPath (internal/modules/cjs/loader.js:632:31) at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1001:27) at Function.Module._load (internal/modules/cjs/loader.js:884:27) at Module.require (internal/modules/cjs/loader.js:1074:19) at require (internal/modules/cjs/helpers.js:72:18) at Object. (/Users/alexkayser/git/apptest/node_modules/run-async/index.js:3:17) {
code: 'ERR_INVALID_PACKAGE_TARGET'
}
Aborting installation. node has failed.
Deleting generated file... node_modules Deleting generated file... package.json
Versions
This is the versions of NPM and Node: npm --version
6.14.4
node --version
v14.0.0
(the problem is not experienced on node 12.12.0)
Which terms did you search for in User Guide?
npx create-react-app
Environment
Environment Info:
current version of create-react-app: 3.4.1 running from /usr/local/lib/node_modules/create-react-app
System: OS: macOS 10.15.4 CPU: (4) x64 Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz Binaries: Node: 14.0.0 - /usr/local/bin/node Yarn: Not Found npm: 6.14.4 - /usr/local/bin/npm Browsers: Chrome: 81.0.4044.122 Firefox: Not Found Safari: 13.1 npmPackages: react: Not Found react-dom: Not Found react-scripts: Not Found npmGlobalPackages: create-react-app: 3.4.1
Steps to reproduce
A simple new app creation:
1.run the command: npx react-create-app somenamehere 2.it aborts and delete the files
Expected behavior
Expected to create a new react app.
Actual behavior
It's not creating a new react app.