You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# nvm_process_parameters() {
# local NVM_AUTO_MODE
# NVM_AUTO_MODE='use'
# while [ "$#" -ne 0 ]; do
# case "$1" in
# --install) NVM_AUTO_MODE='install' ;;
# --no-use) NVM_AUTO_MODE='none' ;;
# esac
# shift
# done
# nvm_auto "${NVM_AUTO_MODE}"
# }
#
# nvm_process_parameters "$@"
opening a shell now doesn't take 10 seconds or more until nvm loads.
which is extremely annoying.
If we do this, a user doesn't have to install node globally through their package manager,
and can be solely installed via nvm.
If a user wants to switch version and opt out of the default, they simply use nvm use.
Not sure why the implementation of nvm use is so frustratingly slow in the first place, it should just source
new paths.
Bonus:
You could pretty much redesign nvm by simply making something more general like a package manager that works for local users rather than global installation. It would pretty much work the same.
e.g.
packagelist:
some-package:1.2.4 http://somemirrorlink
another-package:1.5.4 http://somemirrorlink
...
Nobody should ever be installing node with their package manager.
Additionally, only bin should be in the PATH; not the others.
The speedup you're seeing is just about skipping the nvm use command - if you add --no-use to the sourcing line, with no other changes, you won't see the slowdown.
nvm ONLY works for local users and HAS no global installation, so I'm really confused what you mean here.
adding the above to ./nvm/nvm.sh
also removing:
opening a shell now doesn't take 10 seconds or more until nvm loads.
which is extremely annoying.
If we do this, a user doesn't have to install node globally through their package manager,
and can be solely installed via nvm.
If a user wants to switch version and opt out of the default, they simply use nvm use.
Not sure why the implementation of nvm use is so frustratingly slow in the first place, it should just source
new paths.
Bonus:
You could pretty much redesign nvm by simply making something more general like a package manager that works for local users rather than global installation. It would pretty much work the same.
e.g.
packagelist:
some-package:1.2.4 http://somemirrorlink
another-package:1.5.4 http://somemirrorlink
...
local-apt ~/.fakeroot install
./.fakeroot
./.fakeroot/usr
./.fakeroot/lib
./.fakeroot/bin
local-apt use ~/.fakeroot
then you can treat nvm as a special case of this.
like:
packagegroup:
lts:whatever: node:1.2.4, npm:1.1.4
local-apt ~/.nvm/fakeroots/lts_whatever install lts:whatever
local-apt use ~/.nvm/fakeroots/lts_whatever
but this implementation ought to be like 100 lines of code or even less, probably like 50 lines of code.
The text was updated successfully, but these errors were encountered: