Nazmul Hossain
Nazmul Hossain

Reputation: 2085

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

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

Upvotes: 2

Views: 9351

Answers (5)

Borys Nyzhnyk
Borys Nyzhnyk

Reputation: 11

This problem was resolved in a reddit

https://www.reddit.com/r/vuejs/comments/ie8vab/createnuxtapp_not_working_anyone_else_had_this/

Install it with:

npm i -g create-nuxt-app

Usually npm/npx should propose you to install, but it might not work This issue can appear if during first try the installation was aborted

Upvotes: 1

Mel
Mel

Reputation: 943

I had it working using this command.

npm init nuxt-app <project-name>

Upvotes: 2

Mospective
Mospective

Reputation: 91

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

Upvotes: 0

ashok kumar
ashok kumar

Reputation: 49

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.

Upvotes: 3

MarvinJWendt
MarvinJWendt

Reputation: 2684

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

Upvotes: 11

Related Questions