You are not logged in.

#1 2024-10-21 02:24:21

ThoughtBubble
Member
Registered: 2024-07-09
Posts: 50

What problems could arise from other package managers?

I want to install npm (and maybe other package managers in the near future). I understand that this might conflict with pacman. I want to know what I need to be mindful about and what steps I will need to take before and after installing a foreign package manager.

Offline

#2 2024-10-21 02:44:50

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: What problems could arise from other package managers?

I'd say just don't use them at all.  Anything available to third party package managers are either A) already in the repos, B) in the AUR, or C) could easily be properly packaged.

But if you do chose to use other package managers, do not run them as root (and thus use them to install only locally to your user's home directory).


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2024-10-21 06:43:14

seth
Member
Registered: 2012-09-03
Posts: 60,779

Re: What problems could arise from other package managers?

1. avoid it
2. avoid it
3. avoid it
4. don't use them in global paths (as root)
5. they can adjust your environment to prefer the local installation paths what can lead to unexpected behavior in completely unrelated clients:
https://bbs.archlinux.org/viewtopic.php?id=298750
https://bbs.archlinux.org/viewtopic.php?id=299449

tl;dr If you can't avoid it, be very mindful of what those tools actually do - wheher they spill into /usr (very bad, basically unmanageable) or pollute your environment (you need to be aware and in control of it) or come up with new and innovative ways to make your life hard.

Offline

#4 2024-10-21 13:18:37

ThoughtBubble
Member
Registered: 2024-07-09
Posts: 50

Re: What problems could arise from other package managers?

The reason I wanted to install npm is so that I can learn web development. If npm is not an option, how do I go about this?

Offline

#5 2024-10-21 13:22:36

seth
Member
Registered: 2012-09-03
Posts: 60,779

Re: What problems could arise from other package managers?

What does npm have to do w/ "web development"?
npm shovels javascript packages onto your system - as mentioned by Trilby, you'll find many of them in the AUR anyway.

Offline

#6 2024-10-21 13:30:58

kermit63
Member
Registered: 2018-07-04
Posts: 288

Re: What problems could arise from other package managers?

I have zero experience with npm, but whenever I wanted to try something that might adversely interfere with my main installation, I resort to using containers/virtualization to shield it.

When I first started using linux, I relied heavily on virtualbox, then migrated to qemu/kvm. Nowadays I use systemd-nspawn. Docker is also a possibility but I never tried it.


Never argue with an idiot, they will drag you down to their level and then beat you with experience.
It is better to light a candle than curse the darkness.
A journey of a thousand miles begins with a single step.

Offline

#7 2024-10-21 15:55:00

ThoughtBubble
Member
Registered: 2024-07-09
Posts: 50

Re: What problems could arise from other package managers?

seth wrote:

What does npm have to do w/ "web development"?
npm shovels javascript packages onto your system - as mentioned by Trilby, you'll find many of them in the AUR anyway.

I'm just trying to follow a particular course.

What would be the pacman equivalent for this command?

npm create vite@latest my-vue-app -- --template vue

Last edited by ThoughtBubble (2024-10-21 15:55:30)

Offline

#8 2024-10-21 17:00:01

snx9
Member
Registered: 2024-05-02
Posts: 6

Re: What problems could arise from other package managers?

What would be the pacman equivalent for this command?

npm create vite@latest my-vue-app -- --template vue

This is perfectly fine to run,this will just init a new vue app and won't interfere with your arch packages.
Just avoid using npm install -g or --global etc ( or configure npm to install global packages in a folder your user owns if you really need to do it. )

Offline

#9 2024-10-21 17:59:26

ThoughtBubble
Member
Registered: 2024-07-09
Posts: 50

Re: What problems could arise from other package managers?

Is there a way I can block that specific command only when the global option is provided? Is there a way to restrict the "npm i" command such that it would only run within a specific directory?

Last edited by ThoughtBubble (2024-10-21 18:05:24)

Offline

#10 2024-10-21 18:26:58

seth
Member
Registered: 2012-09-03
Posts: 60,779

Re: What problems could arise from other package managers?

If you're not running npm as root, it won't be able to install anything globally.
Simply don't type stuff blindly into an interactive shell, no matter what it is. Always try to understand what's that gonna do first.

Offline

#11 2024-10-21 19:28:15

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: What problems could arise from other package managers?

Is someone else entering commands on your machine?  If you don't want to use the -g / --global flag, then just don't use it.  As seth notes, these options would require root access, so that's a layer of safety, but other than that are you asking for a way to prevent yourself from entering a command that you don't want to enter??  If so, I'd recommend the low tech solution.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#12 2024-10-21 22:42:27

Succulent of your garden
Member
Registered: 2024-02-29
Posts: 129

Re: What problems could arise from other package managers?

In my experience a time ago, if you use the installation without global mode you will be fine. The packages will be installed in your project only and not in your system. Then you can setup the json config file to your needs, for example if you want to omit something. I worked with angular also and with nodejs with npm an i had zero times breaking the system in my project. Yes full js backend also with express js.  Hope it helps you with your project.

Last edited by Succulent of your garden (2024-10-21 22:44:31)

Offline

Board footer

Powered by FluxBB