npx create-react-app 后纱线启动不起作用

Posted

技术标签:

【中文标题】npx create-react-app 后纱线启动不起作用【英文标题】:yarn start doesn't work after npx create-react-app 【发布时间】:2021-01-05 19:05:56 【问题描述】:

我在 Mac 终端中创建了一个 react 应用:

npx create-react-app robofriends
cd my-app
yarn-start

我收到以下错误:

dyld: lazy symbol binding failed: Symbol not found: _FSEventStreamCreate<br>
  Referenced from: /robofriends/node_modules/webpack-dev-server/node_modules/fsevents/build/Release/fse.node<br>
  Expected in: flat namespace


dyld: Symbol not found: _FSEventStreamCreate<br>
  Referenced from: ./my-app/node_modules/webpack-dev-server/node_modules/fsevents/build/Release/fse.node<br>
  Expected in: flat namespace

error Command failed with exit code 1.<br>
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.`

节点版本:v14.11.0

NPM 版本:6.14.8

macOS Catalina 版本 10.15.5

我的 package.json 文件:


  "name": "robofriends",
  "version": "0.1.0",
  "private": true,
  "dependencies": 
    "@testing-library/jest-dom": "^4.2.4",
    "@testing-library/react": "^9.3.2",
    "@testing-library/user-event": "^7.1.2",
    "react": "^16.13.1",
    "react-dom": "^16.13.1",
    "react-scripts": "3.4.3"
  ,
  "scripts": 
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  ,
  "eslintConfig": 
    "extends": "react-app"
  ,
  "browserslist": 
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  

【问题讨论】:

【参考方案1】:

我认为是纱线开始,而不是纱线开始。而在此之前, cd 表示“更改目录”。您必须执行cd robofriends(因为是目录的名称)才能进入目录,然后运行命令yarn start

【讨论】:

以上是关于npx create-react-app 后纱线启动不起作用的主要内容,如果未能解决你的问题,请参考以下文章

npx 使用纱线吗?

npx

npx create-react-app my-app 创建后删除已安装的 node_modules 包?

是否有任何纱线相当于 npx preact create?

每次我运行 npx create-react-app my-app 时,它都会在 npm start 后显示这个 html webpack 错误

“npx create-react-app appname”不起作用