[英]npx create-nuxt-app <project-name> not working
You have a space in your Windows username.您的 Windows 用户名中有一个空格。 This is a problem with NPX .
这是NPX的问题。
This is the path that NPM sees (which is right)这是NPM看到的路径(这是对的)
This is the path that NPX sees (which is wrong)这是NPX看到的路径(这是错误的)
You can fix it by changing your NPM-Cache to another directory (without a space in the path):您可以通过将 NPM-Cache 更改为另一个目录(路径中没有空格)来修复它:
npm config set cache C:\your\new\path\npm-cache --global
Source: https://github.com/zkat/npx/issues/146#issuecomment-384016791来源: https : //github.com/zkat/npx/issues/146#issuecomment-384016791
I changed npm-cache directory by writing following command我通过编写以下命令更改了 npm-cache 目录
npm config set cache C:\tmp\nodejs\npm-cache --global
After that npx create-nuxt-app <project-name>
worked perfectly.之后
npx create-nuxt-app <project-name>
完美运行。
我使用这个命令让它工作。
npm init nuxt-app <project-name>
This problem was resolved in a reddit此问题已在 reddit 中解决
https://www.reddit.com/r/vuejs/comments/ie8vab/createnuxtapp_not_working_anyone_else_had_this/ https://www.reddit.com/r/vuejs/comments/ie8vab/createenuxtapp_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通常 npm/npx 应该建议您安装,但它可能无法工作如果在第一次尝试安装时中止,则会出现此问题
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.如果上述解决方案在 Windows 上对您不起作用,还有另一种方法。
npm init nuxt-app project-name
npm init nuxt-app 项目名称
Point number 3 will only work if you run the VS code editor as Administrator.仅当您以管理员身份运行 VS 代码编辑器时,第 3 点才有效。 I am sure it is the same with external terminals.
我确信它与外部端子相同。 Run CMD/Gitbash as Administrator
以管理员身份运行 CMD/Gitbash
Hope this helps.希望这可以帮助。 :D
:D
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.