Home > Software design >  NX ERROR - Nx failed to install dependencies
NX ERROR - Nx failed to install dependencies

Time:11-12

I'm not sure what could be going wrong and the error message is blank whenever I open it. I've searched online for fixes but nothing has helped hence I'm asking here.

My version of node is: v16.1.0 My version of npm: 8.1.3

And I'm currently running Monterey OS on my M1 MacBook.

khalidn@Khalids-MacBook-Air Next % npx create-nx-workspace --preset=next
✔ Workspace name (e.g., org name)     · km
✔ Application name                    · site
✔ Default stylesheet format           · css
✔ Use Nx Cloud? (It's free and doesn't require registration.) · No

>  NX  Nx is creating your workspace.

  To make sure the command works reliably in all environments, and that the preset is applied correctly,
  Nx will run "npm install" several times. Please wait.

✖ Installing dependencies with npm

>  NX   ERROR  Nx failed to install dependencies

  Exit code: 1
  Log file: /var/folders/vk/k0pds4vn1cb7wf1jvbhdj79w0000gn/T/tmp-46552-0zjGtpc1VjRl/error.log

Has anyone else gone through this?

CodePudding user response:

I was able to get it to work by installing it this way in the terminal:

npx create-nx-workspace [workspace name] \
--preset=next \
--style=css \
--appName=[app name]

CodePudding user response:

Alright I looked into it and the problem occurs when the full path to your nx repo has spaces in it.

Looking through the log that is generated the make compiler complains that a folder is missing and its due to the fact that its looking for that folder in the partial path.

I am not sure who is responsible for fixing this issue but the workaround would be to make sure your path to the nx repo does not have any spaces in it!

  • Related