Install

  1. OPENBSD Install and Update To Latest Stable Version
  2. Step 1 : install using port
  3. pkg_add node
  4. This will give us node version 12.22.6 and npm 6.14.15 which is so outdated as 2021 November

0dev# pkg_add node

quirks-4.53 signed on 2021-11-16T18:52:34Z
node-12.22.6p0: ok
--- +node-12.22.6p0 -------------------
You may wish to add /usr/local/lib/node_modules/npm/man to /etc/man.conf
You may wish to add /usr/local/lib/node_modules/sshpk/man to /etc/man.conf

0dev# node -v
v12.22.6

0dev# npm -v
6.14.15

  1. lets update NPM to the latest version

0dev# npm install -g npm@latest
/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
/usr/local/bin/npx -> /usr/local/lib/node_modules/npm/bin/npx-cli.js
+ npm@8.1.3
added 70 packages from 18 contributors, removed 290 packages and updated 148 packages in 33.467s
0dev# npm -v
8.1.3
0dev# 

  1. As per november 17 2021 latest is 8.1.3
  2. Next we want to upgrade node the latest LTS
  3. Add Bash shell and wget

0dev# pkg_add wget bash    
quirks-4.53 signed on 2021-11-16T18:52:34Z
wget-1.21.2: ok
bash-5.1.8: ok



# 0dev$ wget https://nodejs.org/dist/v16.13.0/node-v16.13.0.tar.gz
# as for now the latest version is node-v16.13.0.tar.gz
# 0dev$ tar -zxvf node-v16.13.0.tar.gz 

# Now Lets Install all dependency so that we can compile node

[@



0dev# pkg_add gcc g++ gmake python3 python openssl
quirks-4.53 signed on 2021-11-16T18:52:34Z
Ambiguous: choose package for gcc
a	0: <None>
	1: gcc-8.4.0p9
	2: gcc-11.2.0p0
Your choice: 2
gcc-11.2.0p0:gmp-6.2.1p0: ok
gcc-11.2.0p0:mpfr-4.1.0: ok
gcc-11.2.0p0:libmpc-1.1.0: ok
gcc-11.2.0p0:gcc-libs-11.2.0p0: ok
gcc-11.2.0p0: ok

Ambiguous: choose package for g++
a	0: <None>
	1: g++-8.4.0p9
	2: g++-11.2.0p0
Your choice: 2
g++-11.2.0p0: ok
python3-3.8p0: ok

Ambiguous: choose package for python
a	0: <None>
	1: python-2.7.18p3
	2: python-3.8.12
	3: python-3.9.7
Your choice: 3
python-3.9.7: ok

Ambiguous: choose package for openssl
a	0: <None>
	1: openssl-1.0.2up4
	2: openssl-1.1.1lp0
	3: openssl-3.0.0
Your choice: 3
openssl-3.0.0: ok
--- +openssl-3.0.0 -------------------
You may wish to add /usr/local/lib/eopenssl30/man to /etc/man.conf



# ln -s /usr/local/bin/egcc /usr/local/bin/gcc
# ln -s /usr/local/bin/eg++ /usr/local/bin/g++

# last install assembler 

[@

0dev# pkg_add gas 
0dev# mv /usr/bin/as /usr/bin/as.old
0dev# ln -s /usr/local/bin/gas /usr/bin/as    


  1. next configure in node directory as normal user
  2. make sure using bash by typing bash first to switch shell
  3. 0dev# pkg_add pkglocatedb



bash-5.1$ ./configure 
Node.js configure: Found Python 3.9.7...
INFO: configure completed successfully

bash-5.1$ gmake

----
FAILED TO BUILT PACKAGE  , NEED MORE TO BE DONE
----