[英]How to Install Deno on Ubuntu
我運行的命令是:
curl -fsSL https://deno.land/x/install/install.sh | sh
output 是:
######################################################################## 100.0%
Archive: /root/.deno/bin/deno.zip
inflating: deno
Deno was installed successfully to /root/.deno/bin/deno
Manually add the directory to your $HOME/.bash_profile (or similar)
export DENO_INSTALL="/root/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"
Run '/root/.deno/bin/deno --help' to get started
在此之后,我在終端中運行deno
,它給了我一個錯誤。
誰能解釋如何在 Ubuntu 中正確安裝 Deno?
通過在其官方網站上運行以下命令來安裝 Deno
curl -fsSL https://deno.land/x/install/install.sh | sh
安裝后更新配置文件目錄中的.bashrc
文件:
sudo nano ~/.bashrc
然后在文件中添加這兩行
export DENO_INSTALL="/$HOME/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"
您可以從安裝 deno 后收到的消息中獲取這兩行
最后運行以下命令source ~/.bashrc
之后通過在終端deno
該視頻詳細解釋了安裝過程 在ubuntu 上安裝 deno
打開你的終端並運行它
curl -fsSL https://deno.land/x/install/install.sh | sh
用戶名:打開 termianla 並運行whoami
現在在.bashrc 文件中設置路徑
為打開的文件運行nano.bashrc
並將下面的代碼替換為用戶名
export DENO_INSTALL="/root/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"
export PATH="/home/username/.deno/bin:$PATH"
最后運行以下命令source ~/.bashrc
現在在你的終端中運行deno
安裝程序已經告訴您安裝完成后要做什么:
手動將目錄添加到您的 $HOME/.bash_profile (或類似)
出口 DENO_INSTALL="/root/.deno"
導出 PATH="$DENO_INSTALL/bin:$PATH"
export DENO_INSTALL="/root/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"
您可以直接在終端中運行這兩行以開始在當前終端中使用它,或者只需編輯並將它們添加到$HOME/.bashrc
或$HOME/.bash_profile
(或類似)
您必須在安裝后將以下命令添加到您的 bash 配置文件中。 通常是~/.bashrc
或~./bash_profile
export DENO_INSTALL="/root/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"
(請記住,上述命令可能會更改,因此請始終使用從安裝輸出中獲得的值)
正如您在安裝的 output 中看到的:
Deno 已成功安裝到 /root/.deno/bin/deno。
手動將目錄添加到您的 $HOME/.bash_profile (或類似)
添加這兩行后,您可以啟動一個新終端,或者使用source
命令加載您的 bash 配置文件
source ~/.bashrc
# or source ~/.bash_profile
如果要安裝特定版本,可以在該命令中添加: -s {version}
:
curl -fsSL https://deno.land/x/install/install.sh | sh -s v0.42.0
您必須在 ubuntu 系統中進行全局配置。 所以首先,
nano ~/.bashrc
source ~/.bashrc
然后只需 source bashrc 文件。
source ~/.bashrc
我也面臨同樣的問題,但下面的命令對我有用:
curl -fsSL https://deno.land/x/install/install.sh | sudo DENO_INSTALL=/usr/local sh
您必須在bashrc
配置文件中添加腳本。
使用以下任何命令打開bashrc
文件,並在文件末尾添加腳本。 保存文件后,重新啟動終端。
# for gedit text editor
gedit ~/.bashrc
# or for GNU nano editor
nano ~/.bashrc
# deno
export DENO_INSTALL="/home/YOUR_USERNAME/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"
您只需按照命令行
######################################################################## 100.0%
Archive: /root/.deno/bin/deno.zip
inflating: deno
Deno was installed successfully to /root/.deno/bin/deno
Manually add the directory to your $HOME/.bash_profile (or similar)
export DENO_INSTALL="/root/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"
Run '/root/.deno/bin/deno --help' to get started
它告訴你需要 go 到$HOME/.bash_profile
或類似的文件來添加這個配置。
export DENO_INSTALL="/root/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"
這是逐步添加它的方法
sudo nano ~/.bash_profile
或sudo nano ~/.bashrc
(我使用這個是因為我的操作系統是 Ubuntu)export DENO_INSTALL="/root/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"
注意:對於使用 Ubuntu 的人來說,有點不同。
export DENO_INSTALL="/$HOME/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"
deno --version
進行檢查。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.