node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by node)
node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by node)
node: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by node)
node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by node)
node: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by node)
node: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by node)
This is because default node version is 20x, which is not compatible with CentOS 7, Node 16.20.2 should be used.
Supported Node | |
---|---|
local Mac | 22.2.0 |
VPS (CentOS 7x) | 16.20.2 |
I used nvm to manage different versions of node and it is pretty easy to switch default node version.
# check current node
nvm ls
# switch
nvm alias default 16.20.2
# reopen terminal
nvm list
Then I go to sample_reactjs/test-ssr-ts/server and run node server.js, it is fine!