-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nuxi init
fails with yarn
#217
Comments
Additional observation. When using PNPM, |
To keep track of stuff: Yarn 4 released now : https://yarnpkg.com/blog/release/4.0 |
@polarathene – that should be fixed by #272 |
New user here and I've just installed node.js using
This always yields the following error: Because we don't have a project yet, there is no
We also tried Is there something else we can do to get around this error? Thank you for your help. |
@DarkLite1 Hi! You can always set yarn setting(s) via environment variable(s) (although yarn doc page says: use them sparingly) In your case, the following command should do what you need (on Linux/Unix machine): BashYARN_NODE_LINKER='node-modules' npx nuxi init projectname As I see you use Windows (as I do 😃 ), so choose your option: PowerShell$env:YARN_NODE_LINKER='node-modules'; npx nuxi init projectname; $env:YARN_NODE_LINKER=$null CMD
Important: For CMD pay attention that we DO NOT use single quotes around
Note: These commands are not cluttered your system environment variables. Of course, you can set |
I'm having the same experience. Some extra info that might help with the cases. Let me know if this should be an separate ticket. I originally had the same issue as CASE #2 that op posted. I solved in the end by upgrading Yarn. Now I have: Yarn:
Node:
This has made the
output:
I'm guessing under the hood, the installer is passing the directory somewhere and its failing. Might be a windows/unix thing. Trying a bunch of workarounds now. |
Okay, this is quite interesting. It turns out the error above is still related to the Rerunning, |
The Yarn update is a false positive. It just caught old dependencies in the root then created a conflict for some reason. I get the same issue as OP Case 2 on Yarn 4.3.1. |
@danielroe -
output
Side Note: |
That seems like a yarn issue, not a Nuxt one. |
After upgrading Yarn to 4.4.0, I was also getting this error when trying to nuxi init:
I fixed it by adding this to my .yarnrc.yml file:
|
This still seems to be problematic.
If you have docker installed the reproduction should help you verify a proper fix going forward? Below is two failing cases and one that is successful with a bit of extra configuration (that
nuxi init
could configure).Previous issues stating it had been resolved with 3.8:
Related issues on yarn support with nuxt:
node-modules
linker nuxt#22861 (comment)--shamefully-hoist
nuxt#14146 (comment)❌ | Yarn 3.6.3 (defaults to
nodeLinker: pnp
)❌ | Yarn 1.22.19 (no PNP, uses
node_modules
)Try again (with corepack enabled):
✔️ | Yarn 3.6.3 (change to
nodeLinker: node-modules
)Unless you have a way to resolve the issues above (Yarn project seems to want to keep legacy yarn as global by default, only using corepack to upgrade with
yarn dlx
andpackage.json
approaches 🤷♂️ ), you may have to let users know to override the linker via ENV?yarn
you should probably setpackageManager
inpackage.json
to ensure it installs with a newer version of yarn (when corepack is enabled)..yarnrc.yml
withnodeLinker: node-modules
as a minimum. Once you've configuredpacakge.json:packageManager
(must be semver likeyarn@3.6.3
, cannot useyarn@stable
), you can runyarn config set nodeLinker node-modules
to do this (if easier than manually creating the file).EDIT: PNPM support has a related workaround in
nuxi init
with creating a.npmrc
file.NOTE:
yarn dlx
is not a great experience withnuxi
since each time yarn takes about 4 seconds to prepare 🙄 (more of an issue with how yarn works, nothing to do withnuxi
AFAIK)Until
nuxi init
handles the additional yarn support changes. Users should:packageManager
field topackage.json
(better portability).yarn config set nodeLinker: node-modules
(avoid requiring an ENV to override).`yarn build` is successful
Important, since you can use
yarn install
in some nuxt project that is successful (withnodeLinker: pnp
) but fails withyarn build
.The text was updated successfully, but these errors were encountered: