Differences between revisions 4 and 5
Revision 4 as of 2017-08-23 09:17:20
Size: 451
Editor: PieterSmit
Comment:
Revision 5 as of 2021-10-18 00:30:15
Size: 1215
Editor: PieterSmit
Comment:
Deletions are marked like this. Additions are marked like this.
Line 15: Line 15:
 
== Setting up nodejs in build environment, CI ==
 * Here we source .bash_profile, that sources nvm, as bash function.
   * Requires nvm installed and loaded by .bash_profile -> .bashrc
   * Then we use nvm, to select the nodejs version, and then we install yarn
{{{
#!/bin/bash
echo "# source .bash_profile to install nvm as bash function ..."
source ~/.bash_profile

# Exit on any shell error
set -e

nodejs_version="12.16.2"
echo "# use nvm to switch to requested node.js verion ${nodejs_version} ..."
nvm use ${nodejs_version} || nvm install ${notejs_version}

echo "# Using node: $(node --version)"
echo "# Using npm: $(npm --version)"
echo "PATH = $PATH"

npm ls -g yarn || npm install -g yarn
echo "# Using yarn: $(yarn --version)"
}}}

Node JS

  • javascript, serverside, runs on V8-Google javascript engine.

NPM

Setting up nodejs in build environment, CI

  • Here we source .bash_profile, that sources nvm, as bash function.
    • Requires nvm installed and loaded by .bash_profile -> .bashrc

    • Then we use nvm, to select the nodejs version, and then we install yarn

echo "# source .bash_profile to install nvm as bash function ..."
source ~/.bash_profile

# Exit on any shell error
set -e

nodejs_version="12.16.2"
echo "# use nvm to switch to requested node.js verion ${nodejs_version} ..."
nvm use ${nodejs_version} || nvm install ${notejs_version}

echo "# Using node: $(node --version)"
echo "# Using npm: $(npm --version)"
echo "PATH = $PATH"

npm ls -g yarn || npm install -g yarn
echo "# Using yarn: $(yarn --version)"

...


CategoryDevelopement

nodejs (last edited 2023-10-02 09:22:10 by PieterSmit)