FabioAntunes/fish-nvm

npm installed packages don't work untill node is ran

Closed this issue · 1 comments

When opening a new shell session before running any npm installed command I have to run node first:

$ echo $NVM_BIN

$ trash
fish: Unknown command 'trash'
$ npm
Now using node v6.5.0 (npm v3.10.3)

Usage: npm <command>

where <command> is one of:
   access, adduser, bin, bugs, c, cache, completion, config,
   ddp, dedupe, deprecate, dist-tag, docs, edit, explore, get,
   help, help-search, i, init, install, install-test, it, link,
   list, ln, logout, ls, outdated, owner, pack, ping, prefix,
   prune, publish, rb, rebuild, repo, restart, root, run,
   run-script, s, se, search, set, shrinkwrap, star, stars,
   start, stop, t, tag, team, test, tst, un, uninstall,
   unpublish, unstar, up, update, v, version, view, whoami

npm <cmd> -h     quick help on <cmd>
npm -l           display full usage info
npm help <term>  search for help on <term>
npm help npm     involved overview

Specify configs in the ini-formatted file:
   /Users/matteo/.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config

npm@3.10.3 /Users/matteo/.nvm/versions/node/v6.5.0/lib/node_modules/npm
$ echo $NVM_BIN
/Users/matteo/.nvm/versions/node/v6.5.0/bin
$ trash
Specify at least one path

Sourcing nvm on shell init delays it's initial start by almost two seconds, you can read more about that here #3 and #2