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

如何解决Adobe Aria的npm错误代码128问题?

解决shadcn安装@react-aria/css时的SSH权限错误

错误根源

shadcn最新版本的依赖解析逻辑出了问题——它把@react-aria/components下的子组件(比如Text、Button)错误识别成了独立的GitHub仓库(比如react-aria-components/Text.git),导致npm尝试通过SSH克隆这些根本不存在的仓库,最终触发权限拒绝报错。

修复方法

方法1:用官方提示的旧版本shadcn

直接运行官方给出的旧版本命令,能绕过这个解析bug:

npx shadcn@4.10.0 add @react-aria/css

方法2:手动装核心依赖再跑shadcn

如果想坚持用最新版shadcn,先手动安装正确的npm包:

npm install clsx tailwind-merge react-aria-components lucide-react class-variance-authority tw-animate-css radix-ui @fontsource-variable/geist

之后重新运行shadcn命令,它会跳过依赖安装步骤,直接处理配置文件:

npx shadcn@latest add @react-aria/css

方法3:修复components.json配置

如果已经生成了components.json文件,打开它检查dependencies字段,把所有类似react-aria-components/Text的错误路径改成react-aria-components,保存后重新运行安装命令即可。

额外提示

  • 可以临时把git的协议从SSH切换成HTTPS,避免权限问题:
    git config --global url."https://github.com/".insteadOf ssh://git@github.com/
    
  • 要是以上方法都不管用,直接去shadcn的仓库提issue,说明你用的是Vite+Tailwind v4环境。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.06 04:45:40