question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

can't run yarn build get issue from Css Minimizer plugin Error: Cannot find module 'normalize-url'

See original GitHub issue

Describe the bug

Can’t build fresh project with yarn build

Did you try recovering your dependencies?

yes ❯ yarn --version 1.22.15

Which terms did you search for in User Guide?

Css Minimizer plugin Error: Cannot find module ‘normalize-url’

Environment

npx create-react-app --info

Environment Info:

current version of create-react-app: 5.0.0 running from C:\Users\kowalski\AppData\Local\Yarn\Data\global\node_modules\create-react-app

System: OS: Windows 10 10.0.19043 CPU: (8) x64 Intel® Xeon® CPU E3-1505M v5 @ 2.80GHz Binaries: Node: 17.4.0 - C:\Files\nodejs17\node.EXE Yarn: 1.22.15 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 8.3.1 - C:\Files\nodejs17\npm.CMD Browsers: Chrome: Not Found Edge: Spartan (44.19041.1266.0), Chromium (97.0.1072.62) Internet Explorer: 11.0.19041.1202 npmPackages: react: ^17.0.2 => 17.0.2 react-dom: ^17.0.2 => 17.0.2 react-scripts: 5.0.0 => 5.0.0 npmGlobalPackages: create-react-app: Not Found

Steps to reproduce

(Write your steps here:)

  1. yarn create react-app my-app2 --template typescript
  2. cd my-app2
  3. yarn build

Expected behavior

should get builded app

Actual behavior

❯ yarn build yarn run v1.22.15 $ react-scripts build Creating an optimized production build… Failed to compile.

static/css/main.a6b5f62b.css from Css Minimizer plugin Error: Cannot find module ‘normalize-url’ Require stack:

  • D:\aaaa\my-app2\node_modules\postcss-normalize-url\dist\index.js
  • D:\aaaa\my-app2\node_modules\cssnano-preset-default\dist\index.js
  • D:\aaaa\my-app2\node_modules\cssnano\dist\index.js
  • D:\aaaa\my-app2\node_modules\css-minimizer-webpack-plugin\dist\minify.js
  • D:\aaaa\my-app2\node_modules\jest-worker\build\workers\threadChild.js image

Reproducible demo

my-app2-for-issue.zip

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:18

github_iconTop GitHub Comments

12reactions
anazbinnoushadcommented, Feb 8, 2022

yes i faced the same issue , i solved it

1reaction
frontowieccommented, Feb 11, 2022

yarn add --dev postcss-normalize it worked for me

Read more comments on GitHub >

github_iconTop Results From Across the Web

error: cannot find module 'css-minimizer-webpack-plugin'
I have deployed this app to Heroku before without issue. Also, usually after "deploying" the first load works but the second does not....
Read more >
css-minimizer-webpack-plugin - npm
Start using css-minimizer-webpack-plugin in your project by ... TypeScript icon, indicating that this package has built-in type declarations.
Read more >
mini-css-extract-plugin | Yarn - Package Manager
It creates a CSS file per JS file which contains CSS. It supports On-Demand-Loading of CSS and SourceMaps. It builds on top of...
Read more >
Module build failed: Error: Cannot find module 'postcss' - Stack ...
I had this error when using autoprefixer with postcss through postcss-cli. I solved it by rolling postcss back to version 8.1.0 (current ...
Read more >
Laracasts Forum
I'm getting two errors when I run Mix, and they make no sense to me: Error 1 ... node_modules/mini-css-extract-plugin/dist/loader.js): ModuleBuildError: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found