Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React App failed to compile after install

After running the install script, the server starts and serves a page displaying the same text after the 'Failed to compile line.'

I'm running Windows 10 and auto update just updated my pc today, right before I did the create-react-express install.


PS H:\mern-passport> npm start

> [email protected] start H:\mern-passport
> if-env NODE_ENV=production && npm run start:prod || npm run start:dev


> [email protected] start:dev H:\mern-passport
> concurrently "nodemon --ignore 'client/*'" "npm run client"

[0] [nodemon] 1.19.4
[0] [nodemon] to restart at any time, enter `rs`
[0] [nodemon] watching dir(s): *.*
[0] [nodemon] watching extensions: js,mjs,json  
[0] [nodemon] starting `node server.js`
[0] API server now on port 3001!
[1] 
[1] > [email protected] client H:\mern-passport
[1] > cd client && npm run start
[1]
[1] 
[1] > [email protected] start H:\mern-passport\client
[1] > react-scripts start
[1]
[1] Starting the development server...
[1]
[1] Failed to compile.
[1]
[1] ./src/index.css (./node_modules/css-loader??ref--6-oneOf-3-1!./node_modules/postcss-loader/src??postcss!./src/index.css)
[1] Error: Package exports for 'H:\mern-passport\client\node_modules\autoprefixer\node_modules\kleur' do not define a valid './colors' target
[0] Error: ENOENT: no such file or directory, stat 'H:\mern-passport\client\build\index.html'
[0] Error: ENOENT: no such file or directory, stat 'H:\mern-passport\client\build\index.html'
like image 368
StephonA Avatar asked Jun 20 '20 04:06

StephonA


Video Answer


2 Answers

Seems to be an issue with autoprefixer latest version. I referred https://github.com/postcss/autoprefixer/issues/1328 and tried downgrading autoprefixer in my project and it works now. Try:

npm install [email protected]

Happy coding!

like image 196
Krishna Avatar answered Oct 12 '22 21:10

Krishna


I also faced this problem. And it looks like a problem with autoprefixer version, so i changed the version.

npm install [email protected]

I tried this, and it works perfectly.

like image 1
Mizael Paredes Vielma Avatar answered Oct 12 '22 20:10

Mizael Paredes Vielma