Showing posts with label nodejs. Show all posts
Showing posts with label nodejs. Show all posts

Tuesday, May 10, 2022

[NodeJS] How the solve problem with building of node-saas(7.0.1) on nodejs 17

Hello, because in some projects I have legacy dependencies (locked versions), I got some problems with modern versions of Node.js interpreter, you will just get errors on trying to build.

You can reproduce it on macOS 12.3.1 and Node.js 17/18. One of the issues – python2, it has issues on modern versions of mac, so you can't install it using brew command.

So, algorithm for solving it:

  1. Install python2 from official site (
  2. which python2
  3. npm config set python /Library/Frameworks/Python.framework/Versions/2.7/bin/python2
  4. Install GCC/clang C++ compiler (hint: you can install Xcode)
  5. CXXFLAGS="--std=c++17" npm i

Saturday, October 17, 2020

[DevOps] NodeJS installation script for hot update

Hello, this is script is needed for the hot switch versions of Node.js on machine. You can have two installed different versions of Node.js. For example, it can be v12 and v14.

So is possible to switch on a different version using only one command. Currently, I work only on Linux based (and macOS as a client system) systems and code will be targeted on these systems

# Install Node.js 14.2.0
sudo su
yum install -y git
curl | bash
source ~/.bashrc
nvm install v14.13.0
# Relevant for some OSes
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/" ] && . "$NVM_DIR/" # This loads nvm
For getting a list of all installed nodes, you can use
nvm ls #list all nodes
nvm use <version># switch to specific version
  1. More information you can get on official repo
  2. Or on another site (first link in google)