install-node: bypass nvm wrapper for faster node startup.

This fixes a significant performance issue with LaTeX rendering (and
other things that invoked node) where starting up node took a few
hundred milliseconds due to nvm initialization.

Tweaked by tabbott to avoid copying the node binary itself, instead
using a tiny wrapper script.

This is important primarily because it's possible a future version of
node will expect to find libraries/dependencies/etc. installed via NVM
at some path related to the path of the node binary itself, and that's
more guaranteed with this new model.

Fixes #4618.
This commit is contained in:
rht
2017-05-09 21:25:31 +07:00
committed by Tim Abbott
parent 86a9283471
commit 00e057bf44
2 changed files with 3 additions and 3 deletions

View File

@@ -1,4 +1,2 @@
#!/bin/bash
export NVM_DIR="/usr/local/nvm"
[ -e "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
node "$@"
NODE_PATH "$@"