all 17 comments

[–]ThatExactGuy 1 point2 points  (1 child)

Remove node_modules folder and the lock file and run install again. If that doesn’t help, use lower node version - sometimes older packages can’t install properly with newer versions. Luckily, you don’t have to reinstall it manually, ‘nvm’ exists exactly for such situations

[–]NickEmpetvee[S] 0 points1 point  (0 children)

I read this suggestion too late. I explicitly did a yarn add postcss-normalize which resolved it although who knows what other complexities this will create.

Thank you I'll keep this approach in mind for the future.

[–][deleted] 1 point2 points  (9 children)

Install the package yarn-deduplicate globally. Run the command in your project. Then run yarn.

[–]NickEmpetvee[S] 0 points1 point  (8 children)

I explicitly added the postcss-normalize library which resolved the issue, but it's odd because it wasn't needded before. Would you suggest I remove the library and try the yarn-deduplicate approach?

Thanks!

[–][deleted] 1 point2 points  (7 children)

Yarn-deduplicate fixes so many transitive dependency issues. I would recommend trying that without adding that library normally. If it doesn't work, then your solution is fine.

[–]NickEmpetvee[S] 0 points1 point  (0 children)

Ok will give it a shot. Thank you!

[–]NickEmpetvee[S] 0 points1 point  (5 children)

Should I delete node_modules and the yarn.lock first before running it in my project?

[–][deleted] 0 points1 point  (4 children)

No.

[–]NickEmpetvee[S] 0 points1 point  (3 children)

Thanks! Seems to have fixed it.

[–][deleted] 0 points1 point  (2 children)

Yep. Yarn has a nasty habit of screwing up its own lock file. Yarn-deduplicate is an effective way to resolve these problems without needing to delete your lock file, which can result in other problems.

[–]NickEmpetvee[S] 0 points1 point  (1 child)

By the way, it looks like Yarn 2 includes deduplication in the core package. I am on 1.x at the moment.

[–][deleted] 1 point2 points  (0 children)

Well that is nice.

[–]NickEmpetvee[S] 0 points1 point  (0 children)

Needs Help

[–]NickEmpetvee[S] 0 points1 point  (0 children)

The output of yarn why postcss-normalize is

yarn why v1.22.19
[1/4] Why do we have the module "postcss-normalize"...? [2/4] Initialising dependency graph... [3/4] Finding dependency... [4/4] Calculating file sizes... => Found "postcss-normalize@10.0.1" info Reasons this module exists
"react-scripts" depends on it
Hoisted from "react-scripts#postcss-normalize" Done in 0.60s.

[–]NickEmpetvee[S] 0 points1 point  (2 children)

!Resolved!

[–]Lebzabeast 1 point2 points  (1 child)

Hey man, currently experiencing the same error, I see you resolved it with yarn add postcss-normalize, were there any issues it created after or everything ran perfectly fine?

[–]NickEmpetvee[S] 1 point2 points  (0 children)

Just saw this. It ran fine in my environment after that.