Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I think npm global packages should be installed in it's own directory #1220

Closed
jeud opened this issue Jan 16, 2017 · 10 comments
Closed

I think npm global packages should be installed in it's own directory #1220

jeud opened this issue Jan 16, 2017 · 10 comments

Comments

@jeud
Copy link

jeud commented Jan 16, 2017

Dear @lukesampson

Thanks for this really awesome tool, it really ease my daily workflow a lot

Because right now using npm -g install ... will install the packages into the versioning directory of nodejs, therefore when upgrading nodejs, we have to reinstall the packages, it's not so bad right now but would be much better not to re-install anything after upgrading

Cheers

@lukesampson
Copy link
Member

I wonder if removing https://github.com/lukesampson/scoop/blob/master/bucket/nodejs.json#L18 would do the trick. Perhaps we would also need to add an environment variable to tell npm to look in ~/appdata/roaming/npm as well.

Are there any Node experts listening that can help with this?

Also, I think @rrelmy is looking at adding special conf directories that would be maintained between updates (see #1185). So that might help with this in the long term.

@deevus
Copy link
Member

deevus commented Jan 17, 2017 via email

@inosik
Copy link
Contributor

inosik commented Jan 17, 2017

I created a .npmrc file in my C:\Users\{me} directory with this content:

prefix=C:\bin\nodejs
cache=C:\bin\nodejs\npm-cache

@rrelmy
Copy link
Collaborator

rrelmy commented Jan 17, 2017

I think using appdata for the packages leads to problems like #847

Using a dedicated data directory inside scoop maybe the best idea.
There could be everything version independ like the npm packages or the php config.

I couldn't start with the change from #1185, but I can do it this evening.

Do mysql and mariadb suffer from the same problem?

@lukesampson
Copy link
Member

Looking way back at #126 and an aborted attempt at a similar thing, it looks like MariaDB, Vagrant, Nginx and Apache suffer from similar problems and would benefit.

@deevus actually suggested a scoop/data/app directory which looks very similar to the new plan. (Sorry I dismissed that idea, dude).

I guess this is not just about configuration, or data, so maybe we could call it "backpack", i.e. ~/scoop/backpack/[app] since it's just the things you take with you when go to a new version. Too cheesy?

@deevus
Copy link
Member

deevus commented Jan 17, 2017 via email

@rrelmy
Copy link
Collaborator

rrelmy commented Jan 17, 2017

Yes, that's ok

I was right now reading that up and looking at your travel_dir proposal but you were faster. ;-)

@rrelmy
Copy link
Collaborator

rrelmy commented Jan 17, 2017

The UNIX way would be separate directories for config etc/$app and data lib/$data.

But the backpack should be enough for us

@jeud
Copy link
Author

jeud commented Jan 21, 2017

I just really have time to try out, the .npmrc solution suggested by @inosik is working just great

Thanks all

@jeud jeud closed this as completed Jan 21, 2017
@inosik
Copy link
Contributor

inosik commented Jan 22, 2017

I think it would be a nice default though if packages like Node.js would install their own packages into a special directory. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants