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

Windows 11安装Bun后npm与Bun命令均失效的问题求助

Windows 11安装Bun后npm与Bun命令均失效的问题求助

各位大佬好!想请教个棘手的问题:我在Windows 11上用了好几年Node.js + npm,结果自从装了Bun之后,所有npm相关功能全崩了——不管是React/React Native项目里的npm start、npm create,就连Bun自己的bun create、bun start也彻底跑不起来。

每次在命令行执行都会弹出这个错误:

error: could not create process
Bun failed to remap this bin to its proper location within node_modules. This is an indication of a corrupted node_modules directory.
Please run 'bun install --force' in the project root and try it again.
If this message persists, please open an issue: https://github.com/oven-sh/bun/issues

现在的情况是,React和Node.js应用要么启动失败,就连新项目都创建不了。我当前的版本信息是:Node v22.18.0、npm v11.5.2、Bun 1.2.21。

我已经尝试过这些办法,但都没解决:

  • 重装Node.js和npm
  • 卸载了Bun
  • 调整系统环境变量里Node和Bun的优先级顺序
  • 针对单个React项目,删除node_modules文件夹后重新执行npm install

有没有大佬碰到过类似问题,或者知道怎么修复的?麻烦指点一下!

内容来源于stack exchange

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.04.07 09:19:36