npx create-nuxt-app <project-name> not working

Viewed 4025

I want to create Nuxt.Js app using npx. But i am getting following error. enter image description here

4 Answers

You have a space in your Windows username. This is a problem with NPX.

This is the path that NPM sees (which is right)

  • Right path

This is the path that NPX sees (which is wrong)

  • enter image description here

You can fix it by changing your NPM-Cache to another directory (without a space in the path):

npm config set cache C:\your\new\path\npm-cache --global

Source: https://github.com/zkat/npx/issues/146#issuecomment-384016791

I changed npm-cache directory by writing following command

npm config set cache C:\tmp\nodejs\npm-cache --global

After that npx create-nuxt-app <project-name> worked perfectly.

I had it working using this command.

npm init nuxt-app <project-name>

I have encountered similar problem and I have multiple spaces in the username.

If the above solutions does not work for you on Windows, there is another way.

  1. Run VS code editor as an administrator.
  2. Open the integrated terminal by clicking on Terminal > New Terminal or by pressing CTRL + SHIFT + '
  3. Instead of using npx use the following

    npm init nuxt-app project-name

Point number 3 will only work if you run the VS code editor as Administrator. I am sure it is the same with external terminals. Run CMD/Gitbash as Administrator

Hope this helps. :D

Related