Skip to content

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

@nieprzecietny

Description

@nieprzecietny

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(R) Xeon(R) 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions