turnkeylinux / tracker

TurnKey Linux Tracker
https://www.turnkeylinux.org
68 stars 16 forks source link

NodeJS app doesn't work as documented #1944

Open JedMeister opened 3 weeks ago

JedMeister commented 3 weeks ago

As Tom points out on the forums, the NodeJS appliance isn't configured as the appliance page says it is. There is a link to the guide there too (and in Tom's post).

As i replied to Tom, it should be how it says it is!

In the meantime, here is a workaround:

su node
mkdir "${HOME}/.npm-packages"
npm config set prefix "${HOME}/.npm-packages"
cat > "${HOME}/.bashrc.d/node" <<'EOF'
NPM_PACKAGES="${HOME}/.npm-packages"

export PATH="$PATH:$NPM_PACKAGES/bin"

# Preserve MANPATH if you already defined it somewhere in your config.
# Otherwise, fall back to `manpath` so we can inherit from `/etc/manpath`.
export MANPATH="${MANPATH-$(manpath)}:$NPM_PACKAGES/share/man"
EOF
chmod +x "${HOME}/.bashrc.d/node"
source "${HOME}/.bashrc.d/node"