Ranter
Join devRant
Do all the things like
				++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
				Sign Up
			Pipeless API
 
				From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
				Learn More
			Comments
		
- 
				
				@IAmAnIssue Will it mean I'll have to reinstall each node module globally installed one by one again?
- 
				
				Delete the stupid global node-module dir, and try again.
 This time - don't give random node code root to your system.
- 
				
				@KuroTenshi67 find the global directory and use chown. Do the same with the binaries.
- 
				
				find the package.json in the folder, the global node_modules is in. Back it up. Wipe node_modules. Check if there's a package-lock.jsonm If yes, delete it, too. After that, make sure the package.json is still there (or there again) and do a npm i -g (without sudo).
- 
				
				@magicMirror @Cultist @Vuetiful Sorry for the late reply, I was busy lately with preparing some birthday parties and resting from some undesired aftermaths ^^'
 In any case, it worked after doing sudo chown -R $USER:$GROUP on the .npm folders. I have tried reinstalling it without sudo, but I seem to not be able to do that with either apt-get or dpkg, which worries me a bit. But I'll figure out how to fix that someday, I suppose.
 Anyway, thank you for your help :)
- 
				
				@KuroTenshi67 use nvm or any node version manager (like « n » by tj) to properly manage your node setup.
 
 Apt will be outdated and can't scale when you work on multiple project.
 
 Or use docker.
- 
				
				@KuroTenshi67 What are you trying to do with apt? install npm packages?
 
 please step away from the keyboard. sleep it off, and come back later when not so drunk.
- 
				
				@magicMirror No, I meant install npm in the first place. That was my reflex whenever I saw a package to download.
 And then I learnt npm could be bundled with nodejs or downloaded from git, cause it's been a long time since I DLed npm, and during that time, I wasn't all fresh on all the ways to get packages lol
 Of course to get things from npm, I do npm i [-g] <package_name> (... except I had to do this with sudo, because I couldn't otherwise because I'm a dumbass, that's why)
- 
				
				@KuroTenshi67 but... you need root to install npm, and node...
 nm. you seem much sober now. I, however, need to go get drunk.
Related Rants









 Found something true as 1 == 1
Found something true as 1 == 1
So it's been a burden I carried for long.
With the way I set npm up, I unconsciously did the installing process with sudo, and thus can't use npm properly without a sudo.
Is there a rather not convoluted way to set it back up so I don't have to use sudo again for that?
question
node
sudo
npm