「curl: (7) Couldn't connect to server」や「curl: (22) The requested URL returned error: 403 Forbidden」、「curl: (22) The requested URL returned error: 404 Not Found」など、() の中に数字が入っているのでそれをエラーコードのリストで確認し、大きな意味で何が起きているのかを確認出来ます。
% npm install -g create-react-app
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
added 67 packages, and audited 68 packages in 4s
4 packages are looking for funding
run `npm fund` for details
2 high severity vulnerabilities
Some issues need review, and may require choosing
a different dependency.
Run `npm audit` for details.
いくつか警告が出ている様ですがとりあえず無視して進みます。
3. React プロジェクトの作成
例として「awesome-project」という React プロジェクトを作成するとします。
コマンド「create-react-app awesome-project」を実行します。
% create-react-app awesome-project
Creating a new React app in /Users/ユーザー名/React/awesome-project.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
added 1934 packages, and audited 1935 packages in 2m
150 packages are looking for funding
run `npm fund` for details
10 moderate severity vulnerabilities
To address all issues, run:
npm audit fix
Run `npm audit` for details.
Initialized a git repository.
Installing template dependencies using npm...
added 56 packages, and audited 1991 packages in 7s
151 packages are looking for funding
run `npm fund` for details
10 moderate severity vulnerabilities
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
Removing template package using npm...
removed 1 package, and audited 1990 packages in 3s
151 packages are looking for funding
run `npm fund` for details
10 moderate severity vulnerabilities
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
Created git commit.
Success! Created awesome-project at /Users/ユーザー名/React/awesome-project
Inside that directory, you can run several commands:
npm start
Starts the development server.
npm run build
Bundles the app into static files for production.
npm test
Starts the test runner.
npm run eject
Removes this tool and copies build dependencies, configuration files
and scripts into the app directory. If you do this, you can’t go back!
We suggest that you begin by typing:
cd awesome-project
npm start
Happy hacking!
%
4. React プロジェクトの実行
% cd awesome-project
% npm start
「awesome-project」フォルダの中に入り、コマンド「npm start」を実行します。
ターミナルの表示が下記に変わり、ブラウザが起動します。
Compiled successfully!
You can now view awesome-project in the browser.
Local: http://localhost:3000
On Your Network: http://192.168.3.3:3000
Note that the development build is not optimized.
To create a production build, use npm run build.
==> Searching for similarly named formulae...
These similarly named formulae were found:
mysql-client mysql-client@5.7
To install one of them, run (for example):
brew install mysql-client
Error: No available formula or cask with the name "mysqlclient".
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.
とりあえず一番初めのエラー「Error: No available formula or cask with the name "mysqlclient".」が気になる。
(venv) % pip install mysql
Collecting mysql
Downloading https://files.pythonhosted.org/packages/bf/5f/b574ac9f70811df0540e403309f349a8b9fa1a25d3653824c32e52cc1f28/mysql-0.0.2.tar.gz
Collecting mysqlclient (from mysql)
Downloading https://files.pythonhosted.org/packages/3c/df/59cd2fa5e48d0804d213bdcb1acb4d08c403b61c7ff7ed4dd4a6a2deb3f7/mysqlclient-2.0.3.tar.gz (88kB)
|████████████████████████████████| 92kB 5.7MB/s
Installing collected packages: mysqlclient, mysql
Running setup.py install for mysqlclient ... done
Running setup.py install for mysql ... done
Successfully installed mysql-0.0.2 mysqlclient-2.0.3
WARNING: You are using pip version 19.2.3, however version 21.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(venv) %
~ % brew install wget
==> Downloading https://homebrew.bintray.com/bottles/gettext-0.20.2_1.catalina.b
==> Downloading from https://akamai.bintray.com/71/71f4ded03e8258b5e6896eebb00d2
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/libunistring-0.9.10.catalin
==> Downloading from https://akamai.bintray.com/ce/ce746662b98d93511b86920011b5c
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/libidn2-2.3.0.catalina.bott
==> Downloading from https://akamai.bintray.com/09/0908585cca518a83f101b2edc0417
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/openssl%401.1-1.1.1g.catali
==> Downloading from https://akamai.bintray.com/19/1926679569c6af5337de812d86f4d
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/wget-1.20.3_2.catalina.bott
==> Downloading from https://akamai.bintray.com/ef/ef65c759c5097a36323fa9c777564
######################################################################## 100.0%
==> Installing dependencies for wget: gettext, libunistring, libidn2 and openssl@1.1
==> Installing wget dependency: gettext
==> Pouring gettext-0.20.2_1.catalina.bottle.tar.gz
🍺 /usr/local/Cellar/gettext/0.20.2_1: 1,923 files, 18.6MB
==> Installing wget dependency: libunistring
==> Pouring libunistring-0.9.10.catalina.bottle.tar.gz
🍺 /usr/local/Cellar/libunistring/0.9.10: 54 files, 4.4MB
==> Installing wget dependency: libidn2
==> Pouring libidn2-2.3.0.catalina.bottle.tar.gz
🍺 /usr/local/Cellar/libidn2/2.3.0: 70 files, 727.8KB
==> Installing wget dependency: openssl@1.1
==> Pouring openssl@1.1-1.1.1g.catalina.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
/usr/local/etc/openssl@1.1/certs
and run
/usr/local/opt/openssl@1.1/bin/c_rehash
openssl@1.1 is keg-only, which means it was not symlinked into /usr/local,
because macOS provides LibreSSL.
If you need to have openssl@1.1 first in your PATH run:
echo 'export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"' >> ~/.zshrc
For compilers to find openssl@1.1 you may need to set:
export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
==> Summary
🍺 /usr/local/Cellar/openssl@1.1/1.1.1g: 8,059 files, 18MB
==> Installing wget
==> Pouring wget-1.20.3_2.catalina.bottle.tar.gz
🍺 /usr/local/Cellar/wget/1.20.3_2: 50 files, 4.0MB
==> Caveats
==> openssl@1.1
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
/usr/local/etc/openssl@1.1/certs
and run
/usr/local/opt/openssl@1.1/bin/c_rehash
openssl@1.1 is keg-only, which means it was not symlinked into /usr/local,
because macOS provides LibreSSL.
If you need to have openssl@1.1 first in your PATH run:
echo 'export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"' >> ~/.zshrc
For compilers to find openssl@1.1 you may need to set:
export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
~ %
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> The following existing directories will be made group writable:
/usr/local/bin
/usr/local/lib
/usr/local/share
==> The following existing directories will have their owner set to *****:
/usr/local/bin
/usr/local/lib
/usr/local/share
==> The following existing directories will have their group set to admin:
/usr/local/bin
/usr/local/share
==> The following new directories will be created:
/usr/local/etc
/usr/local/include
/usr/local/sbin
/usr/local/var
/usr/local/opt
/usr/local/share/zsh
/usr/local/share/zsh/site-functions
/usr/local/var/homebrew
/usr/local/var/homebrew/linked
/usr/local/Cellar
/usr/local/Caskroom
/usr/local/Homebrew
/usr/local/Frameworks
==> The Xcode Command Line Tools will be installed.
Press RETURN to continue or any other key to abort
Downloading Command Line Tools for Xcode
Downloaded Command Line Tools for Xcode
Installing Command Line Tools for Xcode
Done with Command Line Tools for Xcode
Done.
==> /usr/bin/sudo /bin/rm -f /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
Password: