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
{{ message }}
Repository navigation
why "freeze" command only outputs global packages? #71
Hi. I'm trying to understand the rationale on the freeze command only freezing globally installed modules.
I get that nodeenv is useful mainly for installing packages in a virtual node environment in a global fashion. But what about packages installed locally (in a node_modules/) folder?
I'm fairly new to all things virtualenv/nodeenv, so there may be a good reason for only listing global packages when using the nodeenv "freeze" command, but on the other hand, I think I may find it useful to be able to freeze locally installed requirements.
Wouldn't it make some sense to also freeze local packages, particularly, when local node_modules/ isn't kept versioned?
Maybe an -l flag for freeze could come handy.
In the meanwhile, I've taken a look at the definition of freeze and modified the following line (I've just removed the -g option from npm ls) to output locally installed packages in the same fashion:
Activity
ekalinin commentedon May 29, 2014
freezewas added as analogue of thepip freeze.It's main task is to save in a file globally installed packages.
maniqui commentedon May 29, 2014
Thanks @ekalinin.
Wouldn't it make some sense to also freeze local packages, particularly, when local
node_modules/isn't kept versioned?Maybe an
-lflag forfreezecould come handy.In the meanwhile, I've taken a look at the definition of
freezeand modified the following line (I've just removed the-goption fromnpm ls) to output locally installed packages in the same fashion:npm ls | grep -E '^.{4}\w{1}' | grep -o -E '[a-zA-Z0-9\.\-]+@[0-9]+\.[0-9]+\.[0-9]+([\+\-][a-zA-Z0-9\.\-]+)*' | grep -v npmekalinin commentedon Jun 4, 2014
Yes,
-lforfreezecommand — is a good idea.I'll try to add it in the nearest release.