1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AzureにVM(Ubuntsu16.04)作ってNodejsでHTML動かす

Last updated at Posted at 2018-03-13

手順

1:AzureにVMをインストール(OSはUbuntsu)
2:SSHで接続してrootになる(作成したユーザで、sudo suとうてばOK)
3:コマンド
$ git clone https://github.com/creationix/nvm.git ~/.nvm
$ source ~/.nvm/nvm.sh
$ nvm help
errorがでず、helpがでればよい
$ nvm ls-remote
奇数が安定。最新バージョンをインストールする(2018/3/13ではv9.8.0)
$ nvm install 9.8.0
$ node -v
バージョンが表示されればよい

$ nvm alias default v9.8.0
default -> v9.8.0
$ vi ~/.bash_profile
に下記を記載(元々は0)
if [[ -s ~/.nvm/nvm.sh ]];
then source ~/.nvm/nvm.sh
fi

4:これだとrebootした場合に
$ node -v
The program 'node' is currently not installed. You can install it by typing:
apt install nodejs-legacy
になる。
$ node ファイル.js
実行できない、昨日は出来た。
なんで?

5:ここ参照でよい。
https://qiita.com/seibe/items/36cef7df85fe2cefa3ea

単語の意味

・NVM(Node Version Manager)
・nodeコマンドはJavascriptで書いたプログラムを実行するためのコマンド
・npm (Node Package Manager)はnodeコマンド実行時に使用するパッケージ(ライブラリ)をダウンロードしてインストールするためのコマンドだ

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?