root-pc@PC:~$ create-react-app hello-world
Затем появляется ошибка
warning You are using Node "13.0.0-nightly2019062763a0f4cdd3" which is not supported and may encounter bugs or unexpected behavior. Yarn supports the following semver range: "^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0" warning ../package.json: No license field Installing packages. This might take a couple of minutes. Installing react, react-dom, and react-scripts... yarn add v1.16.0 warning You are using Node "13.0.0-nightly2019062763a0f4cdd3" which is not supported and may encounter bugs or unexpected behavior. Yarn supports the following semver range: "^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0" warning ../package.json: No license field [1/4] Resolving packages... warning react-scripts > fsevents@2.0.6: Please update: there are crash fixes [2/4] Fetching packages... error @babel/core@7.4.3: The engine "node" is incompatible with this module. Expected version ">=6.9.0". Got "13.0.0-nightly2019062763a0f4cdd3" error Found incompatible module. info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Как исправить?
Сначала удалите все экземпляры node
и npm
с помощью команды
sudo apt remove -y nodejs
Теперь установите curl
и добавьте источники с помощью команд
sudo apt install curl
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
Установите nodejs
, используя пакет
sudo apt-get install nodejs
Установите create-react-app
sudo npm install -g create-react-app
.Наконец, запустите create-react-app
create-react-app hello-world