mirror of
https://github.com/emrusz/emrusz.git
synced 2025-04-20 12:26:32 -04:00
Compare commits
No commits in common. "d51379df1a9295f0a8d25fb91cf8927bb336d659" and "ad79abd8ac5c8c72321951f7e8f084d28695514f" have entirely different histories.
d51379df1a
...
ad79abd8ac
2 changed files with 1 additions and 48 deletions
|
@ -17,7 +17,7 @@ My homelab is quickly expanding in size, and with the expansion comes a need to
|
|||
|
||||
### Uptime Kuma
|
||||
|
||||
After some consideration I settled on [Uptime Kuma](https://uptime.kuma.pet/), an easy to deploy open source status monitoring solution. Uptime Kuma has all the features that I'll need for my setup, including status pages, custom notifications, and a strong community following. Those aspects made it a clear choice for me.
|
||||
After some consideration I settled on [Update Kuma](https://uptime.kuma.pet/), an easy to deploy open source status monitoring solution. Update Kuma has all the features that I'll need for my setup, including status pages, custom notifications, and a strong community following. Those aspects made it a clear choice for me.
|
||||
|
||||

|
||||
|
||||
|
|
|
@ -1,47 +0,0 @@
|
|||
---
|
||||
title: "NPM Global Without Sudo"
|
||||
categories:
|
||||
- programming
|
||||
tags:
|
||||
- nodejs
|
||||
- npm
|
||||
- linux
|
||||
- security
|
||||
---
|
||||
|
||||
## Don't Use `sudo` With `npm`
|
||||
|
||||
I have seen quite a few programmers install global packages on their machine with `sudo npm`. Generally, that isn't a great idea. I was inspired by Andrew Crites's article "[Don’t Use `sudo` with `npm` …still](https://www.grammarly.com/blog/punctuation-capitalization/italics/)" to post this quick guide on configuring npm prefixes.
|
||||
|
||||
Why shouldn't you use `sudo` with `npm`? Go read Crites's article!
|
||||
|
||||
### Creating a `npm` Prefix
|
||||
|
||||
Set a prefix in your npm configuration using the `npm config` command.
|
||||
|
||||
```bash
|
||||
npm config set prefix '~/.local/'
|
||||
```
|
||||
|
||||
This modifies your `~/.npmrc` to include the following line.
|
||||
|
||||
```bash
|
||||
prefix=~/.local/
|
||||
```
|
||||
|
||||
### Updating `$PATH`
|
||||
|
||||
If you intend to run globally installed packages from the command line you must add the new prefix location to your `$PATH`. Replace `~/.zshrc` with the appropriate configuration file for your shell e.g. `~/.bashrc`.
|
||||
|
||||
```bash
|
||||
mkdir -p ~/.local/bin
|
||||
echo 'export PATH="$HOME/.local/bin/:$PATH"' >> ~/.zshrc
|
||||
```
|
||||
|
||||
### Installing Global Packages
|
||||
|
||||
You can now install global packages in the scope of your user _without_ `sudo`!
|
||||
|
||||
```bash
|
||||
npm i -g packagename
|
||||
```
|
Loading…
Add table
Reference in a new issue