Node.js
start fresh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
rm -rf $HOME/usr/local/bin/node && \
rm -rf $HOME/usr/local/source/node && \
rm -rf $HOME/.npm && \
rm -rf $HOME/.npm_packages && \
export APP="node" ;\
export APP_VERSION="14.16.0" ;\
export APP_PREFIX="${APP}-v" ;\
export APP_URL="https://nodejs.org/download/release/v${APP_VERSION}/node-v${APP_VERSION}.tar.gz" ;\
export SOURCE_PATH="${HOME}/usr/local/source" ;\
export BIN_PATH="${HOME}/usr/local/bin" ;\
export APP_DIR="${APP}/${APP_PREFIX}${APP_VERSION}" ;\
export APP_SOURCE_PATH="${SOURCE_PATH}/${APP_DIR}" ;\
export APP_BIN_PATH="${BIN_PATH}/${APP_DIR}" ;\
export PATH="${APP_BIN_PATH}:${PATH}" ;\
export NPM_PACKAGES="${HOME}/.npm-packages" ;\
export prefix="${HOME}/.npm-packages" ;\
export NODE_PATH="$NPM_PACKAGES/lib/node_modules:$NODE_PATH" ;\
export PATH="$NPM_PACKAGES/bin:$PATH" ;\
export unset MANPATH ;\
export MANPATH="$NPM_PACKAGES/share/man:$(manpath)"
mkdir -p ${SOURCE_PATH}/${APP} && \
mkdir -p ${APP_BIN_PATH} && \
mkdir "${HOME}/.npm-packages" && \
cd "${SOURCE_PATH}/${APP}" && \
echo "${APP_URL}" && \
wget -c $APP_URL -O - | tar -xz && \
cd $APP_SOURCE_PATH && \
./configure --prefix=${APP_BIN_PATH} && \
make -j ${NPROC} && \
make install && \
npm install -g npm@latest
which python && which node && which npm
Source Node and Python home
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
export PYTHON_VERSION=3.9.1 ;\
export APP_VERSION="14.16.0" ;\
export LOCAL_HOME=${HOME}/usr/local ;\
export PYTHON_HOME="${LOCAL_HOME}/bin/python/Python-${PYTHON_VERSION}" ;\
export PATH="${PYTHON_HOME}/bin:${PATH}" ;\
export APP="node" ;\
export APP_PREFIX="${APP}-v"
export BIN_PATH="${HOME}/usr/local/bin" ;\
export APP_DIR="${APP}/${APP_PREFIX}${APP_VERSION}" ;\
export APP_BIN_PATH="${BIN_PATH}/${APP_DIR}" ;\
export PATH="${APP_BIN_PATH}/bin:${PATH}" ;\
export NPM_PACKAGES="${HOME}/.npm-packages" ;\
export prefix="${HOME}/.npm-packages" ;\
export NODE_PATH="$NPM_PACKAGES/lib/node_modules:$NODE_PATH" ;\
export PATH="$NPM_PACKAGES/bin:$PATH" ;\
export unset MANPATH ;\
export MANPATH="$NPM_PACKAGES/share/man:$(manpath)"
remove prevoius versions
1
2
3
4
rm -rf $HOME/usr/local/bin/node && \
rm -rf $HOME/usr/local/source/node && \
rm -rf $HOME/.npm && \
rm -rf $HOME/.npm_packages
Source Python home and set Node paths
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
export PYTHON_VERSION=3.9.1 ;\
export APP_VERSION="14.16.0" ;\
export LOCAL_HOME=${HOME}/usr/local ;\
export PYTHON_HOME="${LOCAL_HOME}/bin/python/Python-${PYTHON_VERSION}" ;\
export PATH="${PYTHON_HOME}/bin:${PATH}" ;\
export APP="node" ;\
export APP_PREFIX="${APP}-v"
export BIN_PATH="${HOME}/usr/local/bin" ;\
export APP_DIR="${APP}/${APP_PREFIX}${APP_VERSION}" ;\
export APP_BIN_PATH="${BIN_PATH}/${APP_DIR}" ;\
export PATH="${APP_BIN_PATH}/bin:${PATH}" ;\
export NPM_PACKAGES="${HOME}/.npm-packages" ;\
export prefix="${HOME}/.npm-packages" ;\
export NODE_PATH="$NPM_PACKAGES/lib/node_modules:$NODE_PATH" ;\
export PATH="$NPM_PACKAGES/bin:$PATH" ;\
export unset MANPATH ;\
export MANPATH="$NPM_PACKAGES/share/man:$(manpath)" ;
Create source and target directories
1
2
3
mkdir -p ${SOURCE_PATH}/${APP} && \
mkdir -p ${APP_BIN_PATH} && \
mkdir "${HOME}/.npm-packages"
Build node from source non root
1
2
3
4
5
6
7
8
cd "${SOURCE_PATH}/${APP}" && \
echo "${APP_URL}" && \
wget -c $APP_URL -O - | tar -xz && \
cd $APP_SOURCE_PATH && \
./configure --prefix=${APP_BIN_PATH} && \
make -j ${NPROC} && \
make install && \
which python && which node && which npm
Upgrade NPM to latest version
1
npm install -g npm@latest
Nuxt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
create-nuxt-app v3.5.2
✨ Generating Nuxt.js project in client
? Project name: client
? Programming language: JavaScript
? Package manager: Npm
? UI framework: Bootstrap Vue
? Nuxt.js modules: Axios - Promise based HTTP client
? Linting tools: ESLint
? Testing framework: Jest
? Rendering mode: Universal (SSR / SSG)
? Deployment target: Server (Node.js hosting)
? Development tools: jsconfig.json (Recommended for VS Code if you're not using typescript)
? Continuous integration: None
? Version control system: Git