These are chat archives for creationix/nvm

27th
Feb 2019
sameeroath
@sameeroath
Feb 27 04:15
Screenshot 2019-02-27 09.45.18.png
Hi guys, can someone please check above image as to why it's happening :/
shouldn't require('<global package name>') just work for me? if yes, can someone please guide me thru steps to fix this.
Jordan Harband
@ljharb
Feb 27 04:50
@sameeroath no, global packages are never requireable
things you require are dependencies - thus they must be in your package.json and locally installed.
global packages are only for non-project-specific command line tools, which are very very rare. almost everything should only ever be locally installed.
sameeroath
@sameeroath
Feb 27 04:53
hmm so codename wont be available in node repl even if its globally installed?
Screenshot 2019-02-27 10.24.08.png
:point_up: and this is fine?
i can require global package by setting that NODE_PATH env
i don't use global packages on projects/apps just using this setup for ad hoc scripts etc.
Jordan Harband
@ljharb
Feb 27 05:07
never do that tho
NODE_PATH is both terrible and deprecated
if you want to require it, make a folder with a package.json or use npx
sameeroath
@sameeroath
Feb 27 05:19
i see thanks @ljharb will remove it