You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

安装Nuxt.js失败:执行npm init nuxt-app命令提示create-nuxt-app未找到

解决Nuxt.js安装报错create-nuxt-app: not found的方法
  • 使用npx直接执行(推荐)
    跳过全局安装,直接通过npx调用最新版create-nuxt-app:

    npx create-nuxt-app@latest new-project-nuxt
    

    若需安装Nuxt 2版本,指定版本号:

    npx create-nuxt-app@2 new-project-nuxt
    
  • 全局安装create-nuxt-app
    先全局安装工具包:

    npm install -g create-nuxt-app
    

    安装完成后执行创建命令:

    create-nuxt-app new-project-nuxt
    

    若仍报错,检查npm全局bin目录是否在系统PATH中:

    1. 执行npm config get prefix获取全局前缀路径,拼接/bin得到命令目录
    2. 将该目录添加到系统环境变量PATH,重启终端后重试
  • 清理npm缓存后重试
    缓存异常可能导致安装失败,清理后重新执行:

    npm cache clean --force
    npx create-nuxt-app@latest new-project-nuxt
    
  • 使用yarn替代npm
    若已安装yarn,可直接用yarn创建项目:

    yarn create nuxt-app new-project-nuxt
    

内容的提问来源于stack exchange,提问作者Erik Qoqobelyan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.10 04:40:29