Programming Self-Study Notebook

勉強したことを忘れないように! 思い出せるように!!

Windows10にnodeをインストールしたときのメモ

f:id:overworker:20210221004420p:plain:h150


自宅PCでnpm installを実施しようとしたら、エラーになってしまいました、、、。 自宅PCが仕事に汚染されていないことにホッとしつつ、 nodeをインストールしたときのメモになります。(お勉強のために、結局インストールしました。)

node.jsがインストールされてないことを確認する

f:id:overworker:20210221005538p:plain:w400
  • Nodeのバージョン確認コマンドnode -vを実施することでインストールの有無、及びインストール中のバージョンが確認できます。
>node -v
'node' は、内部コマンドまたは外部コマンド、
操作可能なプログラムまたはバッチ ファイルとして認識されていません。

<参考>
node.jsがインストールされていない状態で
npm installを実施した際のエラーコメント

  • node.jsがインストールされていない状態でnpm installを実施した際のエラーコメントを掲載します。
>npm install
'npm' は、内部コマンドまたは外部コマンド、
操作可能なプログラムまたはバッチ ファイルとして認識されていません。

nodeのインストーラーを入手する

あまり考えずにインストールしたい場合(最新版LTS)

  • 以下をクリックするとnode-v14.15.5-x64.msiのダウンロードが開始しました。
f:id:overworker:20210221083006p:plain:w350

色々選びたい場合(過去のバージョン等)

f:id:overworker:20210221083449p:plain:w350
f:id:overworker:20210221084640p:plain:w350
f:id:overworker:20210221085234p:plain:w350
f:id:overworker:20210221085448p:plain:w350

インストーラーを起動する

  • 入手したnode-v14.15.5-x64.msiを任意の場所で実行(ダブルクリック)します。
f:id:overworker:20210223082257p:plain:w350
f:id:overworker:20210223082420p:plain:w350
f:id:overworker:20210223082540p:plain:w350
f:id:overworker:20210223082624p:plain:w350

自動インストールのためのToolのインストールについて

f:id:overworker:20210223084957p:plain:w350

Some npm modules need to be compiled from C/C++ when installing.
インストール時にC/C++からのコンパイルが必要なnpmモジュールがあります。

If you want to be able to install such modules, some tools (Python and Visual Studio Build Tools)need to be installed.
そのようなモジュールをインストールできるようにするには、いくつかのツール(Pythonやビジュアルスタジオビルドツール)をインストールする必要があります。

Automatically install the necessary tools.
必要なツールを自動的にインストールします。

Note that this will also install Chocolatey.
これでChocolateyもインストールされますので注意してください。

The script will pop-up in a new window after the installation completes.
インストールが完了すると、スクリプトが新しいウィンドウでポップアップします。

Alternatively, follow the instruction at https://github.com/nodejs/node-gyp#on-windows to install the dependencies yourself
または、リンクの指示に従って、依存関係を自分でインストールします

f:id:overworker:20210223085100p:plain:w350
f:id:overworker:20210223085450p:plain:w250
f:id:overworker:20210223085518p:plain:w350

Windows Power Shellが起動しインストールが始まる

f:id:overworker:20210223085620p:plain:w450

====================================================
Tools for Node.js Native Modules Installation Script
Node.jsネイティブモジュールインストールスクリプト用のツール
====================================================

This script will install Python and the Visual Studio Build Tools, necessary to compile Node.js native modules.
このスクリプトは、PythonとVisualStudioビルドツールをインストールし、必要に応じてNode.jsネイティブモジュールをコンパイルします。

Note that Chocolatey and required Windows updates will also be installed.
Chocolateyと必要なWindowsのアップデートもインストールされることに注意してください。

This will require about 3 Gb of free disk space, plus any space necessary to install Windows updates.
これには、約3 Gbの空きディスク容量に加えて、WindowsUpdateをインストールします。

This will take a while to run.
これは実行に時間がかかります。

Please close all open programs for the duration of the installation.
インストール中は、開いているすべてのプログラムを閉じてください。

If the installation fails, please ensure Windows is fully updated, reboot your computer and try to run this again.
インストールが失敗した場合は、Windowsが完全に更新されていることを確認し、再起動してからもう一度実行してみてください。

This script can be found in the Start menu under Node.js.
このスクリプトは、Node.jsの下のスタートメニューにあります。

You can close this window to stop now.
このウィンドウを閉じて、今すぐ停止できます。

Detailed instructions to install these tools manually are available at https://github.com/nodejs/node-gyp#on-windows
これらを手動でインストールするための詳細な手順はリンクから入手できます。

f:id:overworker:20210223085920p:plain:w450

Using this script downloads third party software
このスクリプトを使用すると、サードパーティのソフトウェアがダウンロードされます

This script will direct to Chocolatey to install packages.
このスクリプトは、Chocolateyにパッケージをインストールするように指示します。

By using Chocolatey to install a package, you are accepting the license for the application, executable(s), or other artifacts delivered to your machine as a result of a Chocolatey install.
Chocolateyを使用してパッケージをインストールすることにより、Chocolateyのインストールの結果としてマシンに配信されるアプリケーション、実行可能ファイル、またはその他のアーティファクトのライセンスに同意したことになります。

This acceptance occurs whether you know the license terms or not.
この承認は、ライセンス条項を知っているかどうかに関係なく発生します。

Read and understand the license terms of the packages being installed and their dependencies prior to installation:
インストールする前に、インストールするパッケージのライセンス条項とそれらの依存関係を読んで理解してください。
- https://chocolatey.org/packages/chocolatey
- https://chocolatey.org/packages/python
- https://chocolatey.org/packages/visualstudio2017-workload-vctools

This script is provided AS-IS without any warranties of any kind
このスクリプトは現状のまま提供され、いかなる種類の保証もありません。

Chocolatey has implemented security safeguards in their process to help protect the community from malicious or pirated software, but any use of this script is at your own risk.
Chocolateyは、悪意のあるソフトウェアや海賊版ソフトウェアからコミュニティを保護するために、プロセスにセキュリティセーフガードを実装していますが、このスクリプトの使用はご自身の責任で行ってください。

Please read the Chocolatey's legal terms of use as well as how the community repository for Chocolatey.org is maintained.
Chocolateyの法的利用規約と、Chocolatey.orgのコミュニティリポジトリがどのように維持されているかをお読みください。

f:id:overworker:20210223113215p:plain:w450
  • Enterキーを押して処理を終了する。

node.jsがインストールされたことを確認する

f:id:overworker:20210223114658p:plain:w400
  • Nodeのバージョン確認コマンドnode -vを実施することでインストールの有無、及びインストール中のバージョンが確認できます。
>node -v
v14.15.5