facebook / create-react-app

Set up a modern web app by running one command.
https://create-react-app.dev
MIT License
102.55k stars 26.8k forks source link

create-react-app starting error - Error: No valid exports main found for '\node_modules\colorette' #9273

Closed matanol closed 3 years ago

matanol commented 4 years ago

When installing create-react-app I get this error when I start the development server (npm start),

./src/index.css (./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-3-1!./node_modules/postcss-loader/src??postcss!./src/index.css) Error: No valid exports main found for 'myproject\node_modules\colorette'

I've reinstalled create-react-app -g and tryed with npx and I still get this error. Is there anything else I can do?

this is the files of my new created react apps - without node_modules: newreactapp.zip

phamtiendat1998 commented 4 years ago

me too :(

GDownes commented 4 years ago

I'm also receiving this issue. Haven't upgrade any packages.

Happening with both:

import 'fontsource-roboto'; and import 'typeface-roboto';

matanol commented 4 years ago

Fixed this problem by upgrading node.js to v14.5, i've had v13.5 and v13.6 in my laptop. and also removing create-react-app globally: npm uninstall -g create-react-app

and using: npx create-react-app myapp

phamtiendat1998 commented 4 years ago

Fixed this problem by upgrading node.js to v14.5, i've had v13.5 and v13.6 in my laptop. and also removing create-react-app globally: npm uninstall -g create-react-app

and using: npx create-react-app myapp

It's not working with me :((

matanol commented 4 years ago

Fixed this problem by upgrading node.js to v14.5, i've had v13.5 and v13.6 in my laptop. and also removing create-react-app globally: npm uninstall -g create-react-app and using: npx create-react-app myapp

It's not working with me :((

I've downloaded the latest node.js version and installed it again, I didn't manually upgraded it.

phamtiendat1998 commented 4 years ago

Fixed this problem by upgrading node.js to v14.5, i've had v13.5 and v13.6 in my laptop. and also removing create-react-app globally: npm uninstall -g create-react-app and using: npx create-react-app myapp

It's not working with me :((

I've downloaded the latest node.js version and installed it again, I didn't manually upgraded it.

Thank you, It's working :))

amitaguptasd commented 4 years ago

Fixed this problem by upgrading node.js to v14.5, i've had v13.5 and v13.6 in my laptop. and also removing create-react-app globally: npm uninstall -g create-react-app and using: npx create-react-app myapp

It's not working with me :((

I've downloaded the latest node.js version and installed it again, I didn't manually upgraded it.

Thank you, It's working :))

I was getting same error and resolved it by this solution. Thanks

nimin1 commented 4 years ago

We can fix this issue by installing autoprefixer. npm install autoprefixer

Nanif commented 4 years ago

Thank you, update node version to 14.5 help me solve this error.

pumano commented 4 years ago

I got this when update my sass-loader or something else with vue, but I has 13x nodejs. After upgrade to latest 14x it fixed.

nguyenquocdaile commented 4 years ago

Upgrade node to version 14.5 will resolve this issue.

imanrousta commented 4 years ago

I was getting the same error. Upgrading node to version 14.5 will resolve the issue. I had v13 Node.

Silent9790 commented 4 years ago

Fixed this problem by upgrading node.js to v14.5, i've had v13.5 and v13.6 in my laptop. and also removing create-react-app globally: npm uninstall -g create-react-app and using: npx create-react-app myapp

It's not working with me :((

Me too. I will try to upgrade to 14.5 rn.

naftalib commented 4 years ago

14+ upgrade solved the prob!

itz-Malc0m commented 4 years ago

i had tried the solution and it worked, but this morning the same issue came up..... still getting the same error

dodandeniya commented 4 years ago

I have tried the solution and its works for me. Thanks for the solution.

leotaozeng commented 4 years ago

Upgrade node to version 14.5 works for me.

RMartires commented 4 years ago

after updating node to 14.5 my npm was giving an error "npm does not support Node.js v14.5.0"

if anyones stuck here use "npm install -g npm" it should fix it

Leconomy commented 4 years ago

Upgrade node to version 14.5 will resolve this issue.

Yes, its works for me!

bumblebee338 commented 4 years ago

Fixed this problem by upgrading node.js to v14.5, i've had v13.5 and v13.6 in my laptop. and also removing create-react-app globally: npm uninstall -g create-react-app

and using: npx create-react-app myapp

Thank you ! It's works for me too.

AnnemarieKohler commented 4 years ago

Fixed this problem by upgrading node.js to v14.5.0. After upgrading, I also had to delete my node_modules folder and rerun npm install.

bumblebee338 commented 4 years ago

Yes, I did the same thing and it worked 🤝, actually there should be an alert for new update available for these. So that in future others don't face same problem only because of version change.

RK

On Tue, 14 Jul, 2020, 7:05 pm Annemarie Köhler, notifications@github.com wrote:

Fixed this problem by upgrading node.js to v14.5.0. After upgrading, I also had to delete my node_modules folder and rerun npm install.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/facebook/create-react-app/issues/9273#issuecomment-658182542, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANE5NQU64JHNZDTTYOPG5H3R3RNILANCNFSM4ORPN4VA .

SumitJadiya commented 4 years ago

This is because latest version of colorette doesn't supported on node Version < 14. Try below steps if you don't want to install node V14.5

To uninstall colorette: npm uninstall colorette

To install colorette version 1.2.0: npm install colorette@1.2.0

This fixed my issue.

Else you can simply upgrade the node version.

DianiSN commented 4 years ago

Thank you @SumitJadiya this fixed the issue and did not have to upgrade node.

hoanguyen2603 commented 4 years ago

Fixed this problem by upgrading node.js to v14.5, i've had v13.5 and v13.6 in my laptop. and also removing create-react-app globally: npm uninstall -g create-react-app

and using: npx create-react-app myapp

Thank you. Its works.

vivekprro commented 4 years ago

Fixed this problem by upgrading node.js to v14.5, i've had v13.5 and v13.6 in my laptop. and also removing create-react-app globally: npm uninstall -g create-react-app and using: npx create-react-app myapp

It's not working with me :((

I've downloaded the latest node.js version and installed it again, I didn't manually upgraded it.

Thank you, It's working :))

By upgrading to node version 14.5 it really started working. Thank you very much

harryheman commented 4 years ago

We can fix this issue by installing autoprefixer. npm install autoprefixer

npm i autoprefixer@9.8.0

constantlyTiTi commented 4 years ago

you can try brew update brew upgrade node then your node will be the latest one.

TomIrimescu commented 4 years ago

left my node version at 13.11.0 on Ubuntu 20.04 npm i autoprefixer@9.8.0 It's working!

tesolotech commented 4 years ago

This is because latest version of colorette doesn't supported on node Version < 14. Try below steps if you don't want to install node V14.5

To uninstall colorette: npm uninstall colorette

To install colorette version 1.2.0: npm install colorette@1.2.0

This fixed my issue.

Else you can simply upgrade the node version.

Thank you i will work fine

e-oloughlin commented 4 years ago

This is because latest version of colorette doesn't supported on node Version < 14. Try below steps if you don't want to install node V14.5

To uninstall colorette: npm uninstall colorette

To install colorette version 1.2.0: npm install colorette@1.2.0

This fixed my issue.

Else you can simply upgrade the node version.

Thank for you this. A much more appropriate solution for most people I would imagine then having to upgrade the entirety of node.

ddialar commented 4 years ago

I've tried the proposed Node update to upper version (14.6 in my case) and the error keeps appearing.

I downgraded to Node 12.8.2 using nvm and that worked for me.

Anand0806 commented 4 years ago

Or you can directly go to google -> search "download node js" -> and install the current version(even though you have node js on your machine it updates the latest packages from the contributors)

Mahboob775 commented 4 years ago

Fixed this problem by upgrading node.js to v14.5, i've had v13.5 and v13.6 in my laptop. and also removing create-react-app globally: npm uninstall -g create-react-app and using: npx create-react-app myapp

It's not working with me :((

I've downloaded the latest node.js version and installed it again, I didn't manually upgraded it.

Thank you, It's working :))

dvirben123 commented 4 years ago

Fixed this problem by upgrading node.js to v14.5, i've had v13.5 and v13.6 in my laptop. and also removing create-react-app globally: npm uninstall -g create-react-app and using: npx create-react-app myapp

It's not working with me :((

I've downloaded the latest node.js version and installed it again, I didn't manually upgraded it.

Thank you, It's working :))

I was getting same error and resolved it by this solution. Thanks

Just upgrade to node 14.5 (with nvm) and it solved the issue for me

umer310 commented 4 years ago

npm uninstall -g create-react-app and using: npx create-react-app myapp

It's not working with me.

YuanSamuel commented 4 years ago

npm uninstall -g create-react-app and using: npx create-react-app myapp

It's not working with me.

Did you update your node version? Check with node --version

ottis commented 4 years ago

Two working solutions for me (from the thread above, thanks @SumitJadiya and @mattyusdev)

1. Install working version of colorette

2. Upgrade node version to > 14

It would be great if create-react-app worked with the highest LTS version of Node though - sometimes we don't have the luxury of using the current version 🙁

devamiya commented 4 years ago

npm i autoprefixer@9.8.0 works for me with Node v13.3.0

amitpaswan202 commented 4 years ago

When installing create-react-app I get this error when I start the development server (npm start),

./src/index.css (./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-3-1!./node_modules/postcss-loader/src??postcss!./src/index.css) Error: No valid exports main found for 'myproject\node_modules\colorette'

I've reinstalled create-react-app -g and tryed with npx and I still get this error. Is there anything else I can do?

this is the files of my new created react apps - without node_modules: newreactapp.zip

i having the same issue today at the morning and trust me i am freeking out . after after downloding the current version of the node js and while installing just checked the option to download the required packages . then the thepacket installer install all the requirment and the problem was solved . will recomend all of your who is visiting this post please follow the steps and the problem will solve

annetjohn commented 4 years ago

Fixed this problem by upgrading node.js to v14.5, i've had v13.5 and v13.6 in my laptop. and also removing create-react-app globally: npm uninstall -g create-react-app and using: npx create-react-app myapp

It's not working with me :((

I've downloaded the latest node.js version and installed it again, I didn't manually upgraded it.

Thank you, It's working :))

By upgrading to node version 14.5 it really started working. Thank you very much

Thank you so much! by updating the node.js version to the latest solved the npm start issue.

cking27 commented 4 years ago

I was installing on an existing project so I didn't want to upgrade node. I had to downgrade colorette and autoprefixer. I am currently using node v13.2.0

npm uninstall colorette npm install colorette@1.2.0

npm uninstall autoprefixer npm install autoprefixer@9.8.0

Thanks (this was all based on your comments above.

SumitJadiya commented 4 years ago

https://github.com/facebook/create-react-app/issues/9273#issuecomment-658377736

abruno92 commented 4 years ago

Fixed this problem by upgrading node.js to v14.5, i've had v13.5 and v13.6 in my laptop. and also removing create-react-app globally: npm uninstall -g create-react-app and using: npx create-react-app myapp

It's not working with me :((

I've downloaded the latest node.js version and installed it again, I didn't manually upgraded it.

This also worked for me! Thank you :-)

dombryla commented 4 years ago

I have instaled the latest version of node and it is fixed my problem.

nuomj commented 4 years ago

We can fix this issue by installing autoprefixer. npm install autoprefixer

npm i autoprefixer@9.8.0

Thanks, this solved my problem

ai commented 4 years ago

This error happens because of ESM bug in Node.js 13.

The right solution is not to downgrade Autoprefixer (since you will have more problem with ESM packages in the future), but to update Node.js to 14.x (also, Node.js 13 has no security updates, it is not safe to use it in production).

3abdawy commented 4 years ago

Fixed this problem by upgrading node.js to v14.5, i've had v13.5 and v13.6 in my laptop. and also removing create-react-app globally: npm uninstall -g create-react-app and using: npx create-react-app myapp

It's not working with me :((

I've downloaded the latest node.js version and installed it again, I didn't manually upgraded it.

This really works ! :D Thank you so much

nuomj commented 4 years ago

This error happens because of ESM bug in Node.js 13.

The right solution is not to downgrade Autoprefixer (since you will have more problem with ESM packages in the future), but to update Node.js to 14.x (also, Node.js 13 has no security updates, it is not safe to use it in production).

Thank you, finally using node14.8.0, npm upgrade to the latest solved my problem

looqmaan commented 4 years ago

I got the same error today in my reactjs project after I deleted my package-lock.json file and node_modules folder, ran npm install, and npm start. I had to upgrade my node from v13.* to v14.8.0 on my Debian 10. It works although it doesn't explain the root cause or reasons. Thanks for the tips though.