Skip to content

Install source without sudo on Linux

Lauri Ojansivu edited this page Sep 25, 2023 · 6 revisions

In-progress script for installing npm modules locally. Not tested.

Anyone: If you get this working, edit this wiki and add remaining to be installed locally.

TODO

Related info

Only this run with sudo

sudo apt-get install build-essential c++ capnproto nodejs nodejs-legacy npm git curl

Install npm modules etc locally

# Local node module install from here:
# https://docs.npmjs.com/getting-started/fixing-npm-permissions

# If NPM global package directory does not exists
if [ ! -d "~/.npm-global" ]; then
  # Create it
  mkdir ~/.npm-global
fi

# If .npm-global/bin is in the path
if grep -Fxq "export PATH=~/.npm-global/bin:$PATH" ~/.bashrc
then
    # Continue
else
    # Add it to path
    echo "export PATH=~/.npm-global/bin:$PATH" >> ~/.bashrc
    # Add it to current path in RAM
    export PATH=~/.npm-global/bin:$PATH
fi

Install packages globally to local ~/.npm-global directory

npm -g install n
npm -g install [email protected] 
npm -g install node-gyp
npm -g install node-pre-gyp
npm -g install [email protected]

Install meteor

Continue at Install from source