Closed djflorio closed 1 year ago
yarn add corepack
fixes the problem. I'm just not sure if this is supposed to be necessary.
However, a similar issue happens when I run yarn dlx @yarnpkg/sdks vscode
to set up vscode for pnp. I get:
Error: Your application tried to access color-convert, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound.
Required package: color-convert Required by: C:\Users\######\AppData\Local\Yarn\Berry\cache\ansi-styles-npm-4.3.0-245c7d42c7-10.zip\node_modules\ansi-styles\
Solved after looking at #5699
Somehow I managed to accidentally generate a .pnp.cjs
file in my HOME folder. After removing that, things started working as expected.
For anyone who finds this issue in search results and is as unobservant as me, let me reiterate the point from the comment above:
Check if you have a .pnp.cjs
file in your HOME folder. If you do, remove it.
Self-service
Describe the bug
I'm on Windows 11, and using nvm-windows to manage my node version. EDIT: I completely removed nvm-windows and installed node 20.9.0 directly, and this same issue is happening, so this isn't related to nvm-windows.
When setting up a nextjs project using yarn berry, I get this error:
I also have a project using yarn berry that works fine my mac (which uses regular nvm), but when I try to build it on this Windows machine, the above error occurs.
To reproduce
On a Windows 11 machine using nvm-windows. Node version set to 18.16.0 or above.
Create an empty folder, then:
corepack enable
yarn set version berry
(currently 4.0.1)yarn init -2
yarn dlx create-next-app@latest test
Environment
Additional context
No response