Ingap.dev - A Personal Dev Blog

If the only tool you have is a hammer, it is tempting to treat everything as if it were a nail. (Abraham Maslow)

Published on Wednesday 11 January 2023

Tags: yarn1 reactjs4

[SOLVED] YARN create react app not working: the nearest package directory...

ERROR: the nearest package directory doesn't seem to be part of the project declared in [...]


Error

ERROR: the nearest package directory doesn’t seem to be part of the project declared in [...]

Solution

I solved by just deleting any other package.json in the path. E.g. my script was in /A/B/C/D but somehow a package.json was placed in /A/B, so by removing it the problem got solved.