[Solved] Creating New Project Keeps Failing
I have been trying to create a new Nuxt project (both with npm and pnpm) and each time it is failing with the following error in terminal .... Could someone explain to me where I am going wrong? (I even tried following the setup guide in resorces with the same result)
7 Replies
Hi @Dante. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
The error you are encountering:
is a known issue when creating or installing Nuxt projects (especially Nuxt 4.x) on certain Node.js and npm versions. The root cause is a bug in npm related to how it handles optional dependencies, which affects the installation of native bindings required by the
Some users have found that switching package managers can help, but the most reliable fix is updating Node.js. 4. If the problem persists:
As a workaround, some users have manually installed the missing native bindings, but this should not be necessary if you are on a supported Node.js version. References from similar issues: - Users on Linux and Windows have reported this exact error, and upgrading Node.js to 22.20.0 or higher resolved it for them. The Nuxt team has confirmed this is not a Nuxt bug, but rather a Node/npm compatibility issue with the oxc-parser package and optional dependencies handling. See the discussion and confirmations here: Can't install Nuxt 4.1.3 on linux and Can't build on Windows. Summary:
Update your Node.js to the latest LTS (preferably 22.20.0 or higher), delete your
oxc-parser package. This is especially common on Windows, but can also occur on Linux and macOS.
What you can do:
1. Delete node_modules and lock files, then reinstall:
- Remove both node_modules and your lock file (package-lock.json or pnpm-lock.yaml).
- Run the install command again (npm install or pnpm install).
2. Update Node.js to the latest LTS version:
- Many users have reported that updating Node.js to the latest LTS (for example, Node 22.20.0 or higher) resolves the issue. Older versions of Node 20 and early Node 22 releases are known to have this problem with Nuxt 4.1.3+ and the oxc-parser bindings.
- You can use nvm (Node Version Manager) to easily switch Node versions on Windows.
3. If you are using npm, try switching to pnpm or vice versa:Some users have found that switching package managers can help, but the most reliable fix is updating Node.js. 4. If the problem persists:
As a workaround, some users have manually installed the missing native bindings, but this should not be necessary if you are on a supported Node.js version. References from similar issues: - Users on Linux and Windows have reported this exact error, and upgrading Node.js to 22.20.0 or higher resolved it for them. The Nuxt team has confirmed this is not a Nuxt bug, but rather a Node/npm compatibility issue with the oxc-parser package and optional dependencies handling. See the discussion and confirmations here: Can't install Nuxt 4.1.3 on linux and Can't build on Windows. Summary:
Update your Node.js to the latest LTS (preferably 22.20.0 or higher), delete your
node_modules and lock file, and reinstall your dependencies. This should resolve the "Cannot find native binding" error when creating a new Nuxt project.
If you continue to have issues after these steps, please provide your Node.js, npm/pnpm, and Nuxt versions for more targeted help.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@332238302457495564> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
@kapa.ai I have tried deleting and reinstalling already, let me try the node thing
Let me check the knowledge base for you again. One moment! :books:
----------------------
Based on the knowledge sources, updating your Node.js version is the recommended next step. Multiple users have reported that this error ("Cannot find native binding...") is resolved by upgrading to the latest Node.js LTS version, specifically Node 22.20.0 or higher. The Nuxt team and contributors have confirmed that this is not a Nuxt bug, but rather an issue with Node/npm compatibility and how optional dependencies are handled for native bindings like
oxc-parser. After updating Node.js, delete your node_modules and lock file again, then reinstall your dependencies. This has been confirmed to resolve the issue for others in similar situations Can't install Nuxt 4.1.3 on linux.
If you still encounter issues after updating Node.js, please share your exact Node.js version and package manager details for further troubleshooting.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@332238302457495564> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
the issue is the npm bug that's described. try updating your version of node or manually installing a newer version of npm
Thank you, I have updated and that fixed it!