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

Created on 6 Jul 2020  ·  67Comments  ·  Source: facebook/create-react-app

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

bug report needs triage

Most helpful comment

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

All 67 comments

me too :(

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

Happening with both:

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

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

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 :((

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.

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 :))

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

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

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

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.

Upgrade node to version 14.5 will resolve this issue.

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

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.

14+ upgrade solved the prob!

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

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

Upgrade node to version 14.5 works for me.

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

Upgrade node to version 14.5 will resolve this issue.

Yes, its works for me!

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.

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.

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
.

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 [email protected]

This fixed my issue.

Else you can simply upgrade the node version.

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

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.

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

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

npm i [email protected]

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

left my node version at 13.11.0 on Ubuntu 20.04
npm i [email protected]
It's working!

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 [email protected]

This fixed my issue.

Else you can simply upgrade the node version.

Thank you i will work fine

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 [email protected]

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.

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.

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)

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 :))

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

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

It's not working with me.

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

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

1. Install working version of colorette

  • In your projects directory run npm uninstall colorette
  • Then install a working version npm install [email protected]
  • npm start should now run without an issue

2. Upgrade node version to > 14

  • I use NVM to manage my node versions (https://github.com/nvm-sh/nvm) so you can install or switch versions using that
  • If you don't have NVM, you can download the current version here https://nodejs.org/en/download/current/
  • If you have brew you could run brew update thenbrew upgrade node

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 🙁

npm i [email protected] works for me with Node v13.3.0

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

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.

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 [email protected]

npm uninstall autoprefixer
npm install [email protected]

Thanks (this was all based on your comments above.

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 :-)

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

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

npm i [email protected]

Thanks, this solved my problem

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).

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

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

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.

I had the same error yesterday using Node.js v13.3.0. Downgrading Node.js to the latest LTS version (v12.18.3 as of this writing) resolved the issue.

Using this command from this thread helped me resolve the issue:

npm install [email protected]

left my node version at 13.11.0 on Ubuntu 20.04
npm i [email protected]
It's working!

This worked for me also, thanks so much for your help!!!

@nadiarashad @anisbhsl do not downgrade Autoprefixer.

The problem is in old Node.js version. You need to update Node.js to 14.x.

@nadiarashad @anisbhsl do not downgrade Autoprefixer.

The problem is in old Node.js version. You need to update Node.js to 14.x.

Updated and it worked! Thanks

left my node version at 13.11.0 on Ubuntu 20.04
npm i [email protected]
It's working!

this worked for me, thanks :smile_cat:

@dailepro thanks, it's work for me

Nothing worked for me.

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 works for me also.
Thx a lot.

why do we need to upgrade node just for a dependecy?

my setup:
create-react-app 3.4.1
node -v13.2.0

the following steps worked for me.
1) downgrade colorette to 1.2.0
npm uninstall colorette
npm install [email protected]

2)install autoprefixer
npm install [email protected]

thanks to @harryheman @SumitJadiya

@harshakns

why do we need to upgrade node just for a dependecy?

Because without a update this error will be repeated in the future in another dependency

why do we need to upgrade node just for a dependecy?

You will loose all Autoprefixer updates by locking old version

All the above solutions didn't work for me so I have again installed the latest version of Node.js and then installed the create-react-app tool globally:
npm install -g create-react-app
And then used the following:
npx create-react-app reactapp

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

1. Install working version of colorette

  • In your projects directory run npm uninstall colorette
  • Then install a working version npm install [email protected]
  • npm start should now run without an issue

2. Upgrade node version to > 14

  • I use NVM to manage my node versions (https://github.com/nvm-sh/nvm) so you can install or switch versions using that
  • If you don't have NVM, you can download the current version here https://nodejs.org/en/download/current/
  • If you have brew you could run brew update thenbrew upgrade node

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 🙁

worked for me

npm install npm@latest fixed the issue for me

As mentioned upgrade node version to 14.5.0.
or node version below fix with:

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 [email protected]

This fixed my issue.

Else you can simply upgrade the node version.
thx to: @SumitJadiya @harryheman
https://github.com/facebook/create-react-app/issues/9273#issuecomment-658377736

AS I am on windows 7 still , I cannot upgrade to latest version of Node
I am on Node 13.0.6

After Reading the comments only when did run these all commands , it worked for me

npm uninstall react-scripts
npm install [email protected]
npm uninstall colorette
npm install [email protected]
npm install [email protected]

and After that I added
import React from "react"; in App.js

Then only it worked for me

@RiteshGhorpade it will be better for your case to downgrade to Node.js 12.

With Node.js 13 you will have only more problems in the future (since more packages start to use ESM and you have no security updates).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alleroux picture alleroux  ·  3Comments

barcher picture barcher  ·  3Comments

alleroux picture alleroux  ·  3Comments

dualcnhq picture dualcnhq  ·  3Comments

oltsa picture oltsa  ·  3Comments