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

使用ext-gen创建ExtJS项目失败:找不到@sencha/ext/package.json模块

问题排查与解决步骤

核心原因

ext-gen 生成项目时未正确拉取 @sencha/ext 核心包,大概率是npm依赖安装过程中断、失败,或是Sencha仓库配置/权限问题导致核心依赖缺失。

具体修复步骤

  • 清理依赖残留,重新安装
    先删除项目根目录下的 node_modules 和 package-lock.json 文件,避免残留缓存干扰:

    # macOS/Linux
    rm -rf node_modules package-lock.json
    # Windows
    rmdir /s /q node_modules && del package-lock.json
    

    进入项目根目录重新执行依赖安装:

    npm install
    

    安装时留意日志,若出现权限/网络错误:

    • 权限问题:Windows用管理员终端,macOS/Linux可加sudo(谨慎使用)
    • 网络问题:切换国内npm镜像,执行 npm config set registry https://registry.npmmirror.com 后再重新安装
  • 检查ext-gen版本匹配度
    确认全局安装的ext-gen版本与ExtJS 7.7.0对应:

    npm list -g @sencha/ext-gen
    

    若版本不匹配,卸载后重装对应版本:

    npm uninstall -g @sencha/ext-gen
    npm install -g @sencha/ext-gen@7.7.0
    
  • 验证Sencha仓库配置与登录状态
    确保npm已配置Sencha私有仓库:

    npm config get "@sencha:registry"
    

    若返回空或错误地址,手动配置:

    npm config set "@sencha:registry" https://npm.sencha.com/
    

    配置后需登录Sencha仓库(需提前注册Sencha账号):

    npm login --registry=https://npm.sencha.com/
    
  • 重新生成项目(可选)
    若以上步骤无效,删除现有项目目录,重新执行ext-gen命令,确保全程无中断或报错:

    ext-gen app -a -t moderndesktop -n ModernApp3
    

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.18 00:53:14