Rocky Linux 9にdenoをインストールする

環境
OSバージョンを確認します
# cat /etc/redhat-release
Rocky Linux release 9.0 (Blue Onyx)

操作方法
1.Denoをインストールします

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# curl -fsSL https://deno.land/x/install/install.sh | sh
######################################################################## 100.0%
Archive: /root/.deno/bin/deno.zip
inflating: /root/.deno/bin/deno
Deno was installed successfully to /root/.deno/bin/deno
Manually add the directory to your $HOME/.bashrc (or similar)
export DENO_INSTALL="/root/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"
Run '/root/.deno/bin/deno --help' to get started
Stuck? Join our Discord https://discord.gg/deno
# curl -fsSL https://deno.land/x/install/install.sh | sh ######################################################################## 100.0% Archive: /root/.deno/bin/deno.zip inflating: /root/.deno/bin/deno Deno was installed successfully to /root/.deno/bin/deno Manually add the directory to your $HOME/.bashrc (or similar) export DENO_INSTALL="/root/.deno" export PATH="$DENO_INSTALL/bin:$PATH" Run '/root/.deno/bin/deno --help' to get started Stuck? Join our Discord https://discord.gg/deno
#  curl -fsSL https://deno.land/x/install/install.sh | sh
######################################################################## 100.0%
Archive:  /root/.deno/bin/deno.zip
  inflating: /root/.deno/bin/deno
Deno was installed successfully to /root/.deno/bin/deno
Manually add the directory to your $HOME/.bashrc (or similar)
  export DENO_INSTALL="/root/.deno"
  export PATH="$DENO_INSTALL/bin:$PATH"
Run '/root/.deno/bin/deno --help' to get started

Stuck? Join our Discord https://discord.gg/deno

2.PATHを通します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# nano ~/.bash_profile
# nano ~/.bash_profile
# nano ~/.bash_profile

以下のコードを記述します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
export DENO_INSTALL="/root/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"
export DENO_INSTALL="/root/.deno" export PATH="$DENO_INSTALL/bin:$PATH"
export DENO_INSTALL="/root/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"

設定内容を反映します

# source ~/.bash_profile

3.denoバージョンを確認します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# deno --version
deno 1.27.0 (release, x86_64-unknown-linux-gnu)
v8 10.8.168.4
typescript 4.8.3
# deno --version deno 1.27.0 (release, x86_64-unknown-linux-gnu) v8 10.8.168.4 typescript 4.8.3
# deno --version
deno 1.27.0 (release, x86_64-unknown-linux-gnu)
v8 10.8.168.4
typescript 4.8.3

4.動作確認
# nano hello.ts
以下のコードを記述します
console.log('Hello World from arkgame’);
ファイルを実行します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# deno run hello.ts
Hello World from arkgame
# deno run hello.ts Hello World from arkgame
# deno run hello.ts
Hello World from arkgame

 

Rocky Linux 9

Posted by arkgame