安裝指定版本的Node js

apt-get install nodejs for specific version

阿強
1 min readDec 15, 2019

安裝firebase CLI時遇到node js版本問題,error log 如下,

/usr/local/lib/node_modules/firebase-tools/node_modules/@grpc/grpc-js/build/src/index.js:47
throw new Error(`@grpc/grpc-js only works on Node ${supportedNodeVersions}`);
^

Error: @grpc/grpc-js only works on Node ^8.13.0 || >=10.10.0
at Object.<anonymous> (/usr/local/lib/node_modules/firebase-

查看Node版本指令

node -v

error log訊息顯示,nodejs必須要升到10.10以上版本,可使用以下指令來install nodejs指定的版本,以10.17.0為範例,指令:

curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash

sudo apt-get install nodejs

可參考nodesource 的github:

--

--

阿強
阿強

Written by 阿強

一個喜歡研究新事物的軟體工程師

No responses yet