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

Win10环境下全新安装Node.js v16.14.0后运行create-react-app报错求助

npx create-react-app fails with MODULE_NOT_FOUND due to space in Windows username

Hi everyone, I'm stuck on a frustrating issue when trying to set up a new React app using create-react-app on Windows 10, and I haven't been able to find any relevant, up-to-date solutions online—most related posts are outdated and don't match my scenario. Let me walk through the details:

My Environment

  • OS: Latest Windows 10
  • Node.js: LTS v16.14.0 (clean, fresh install on the system drive; environment variables/paths are configured correctly)

What I've Tried

  • First, I ran the standard command:
    npx create-react-app myapp
    
  • When that failed, I tried installing create-react-app locally first:
    npm i create-react-app
    
    Then ran:
    npm init react-app my-app
    

Full Error Output

C:\Users\Keith & Vanny>npx create-react-app myapp
'Vanny\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\.bin\' is not recognized as an internal or external command, operable program or batch file.
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module 'C:\Users\create-react-app\index.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

My Thoughts

I think the root issue is the path parsing failure you can see in the first line of the error—Windows Command Prompt is splitting my username (Keith & Vanny) at the space, so it's trying to access Vanny\AppData\... instead of the full path. Even though Node was installed cleanly and my environment paths check out, this batch script parsing error seems to be preventing create-react-app from installing properly.

I'm really stuck here and might have to reach out to the create-react-app core team if I can't find a workaround. Has anyone else run into this exact issue, or does anyone know how to fix it?

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.04.28 12:09:07