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

Linux Deepin系统中create-react-app命令无法运行求助

Fixing "bash: create-react-app: command not found" on Linux Deepin 15

Hey there! I’ve run into this exact snag before—when you install a Node.js package globally but your shell can’t locate the command, it’s almost always a PATH configuration issue. Let’s walk through the steps to get create-react-app up and running:

Step 1: Locate your global package bin directory

First, we need to find where your global Node.js/Yarn packages store their executable files. Run one of these commands depending on how you installed create-react-app:

  • If you used npm:
    npm bin -g
    
  • If you used Yarn:
    yarn global bin
    

This will output a path like /home/your-username/.npm-global/bin or /home/your-username/.config/yarn/global/node_modules/.bin—copy this path, we’ll need it next.

Step 2: Check if the path is in your system PATH

Run this command to view your current PATH settings:

echo $PATH

Look for the bin path you copied in Step 1. If it’s missing from the output, that’s why bash can’t find create-react-app.

Step 3: Add the bin path to your PATH permanently

To make this change stick even after restarting your terminal:

  1. Open your bash configuration file with a simple text editor (nano is great for beginners):
    nano ~/.bashrc
    
  2. Scroll to the bottom of the file and add this line (replace /path/to/your/bin with the path you copied earlier):
    export PATH="$PATH:/path/to/your/bin"
    
  3. Save the file by pressing Ctrl+O, then exit nano with Ctrl+X.
  4. Make the changes take effect right away:
    source ~/.bashrc
    

Alternative: Use npx instead (no global install required)

If you don’t want to tweak PATH settings, you can run create-react-app directly using npx (which comes bundled with Node.js v6+):

npx create-react-app my-react-app

npx will temporarily download the latest version of create-react-app and run it, so you don’t need a global installation at all.

Verify the fix

Run this command to confirm everything works as expected:

create-react-app --version

If it outputs the version number, you’re all set to start building your React app!

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.28 07:19:17