[英]Node.js: console.log message doesn't show up if method throws exception… why?
[英]New version of node.js doesn't show up after installing on Xenial
我似乎安裝了高版本的節點,但它沒有與node -v
命令一起顯示。
(base) $ sudo n 10.11.0
installing : node-v10.11.0
mkdir : /usr/local/n/versions/node/10.11.0
fetch : https://nodejs.org/dist/v10.11.0/node-v10.11.0-linux-x64.tar.xz
installed : v10.11.0 (with npm 6.4.1)
(base) $ node -v
v8.0.0
(base) $ ng
You are running version v8.0.0 of Node.js, which is not supported by Angular CLI 8.0+.
The official Node.js version that is supported is 10.9 or greater.
Please visit https://nodejs.org/en/ to find instructions on how to update Node.js.
從問題正文中顯示的輸出中,我注意到sudo n 10.11.0
已在此目錄中安裝了新版本的node
: /usr/local/n/versions/node/10.11.0
。
該路徑需要添加到$PATH
以便 bash 找到它,如下所示:
PATH=/usr/local/n/versions/node/10.11.0/bin/:$PATH
將以下導出語句添加到~/.bashrc
:
export PATH=/usr/local/n/versions/node/10.11.0/bin/:$PATH
需要新開一個終端才能看到修改~/.bashrc
的效果
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.