LMSouq
general-dev Open

NPM modules won't install globally without sudo

HE
HeberLZ
1 month ago
3 views
Problem Description
**I have just reinstalled Ubuntu 12.04 LTS, and before anything else i did these steps**: 1. Installed Node via package manager with the following script sudo apt-get update sudo apt-get install python-software-properties python g++ make sudo add-apt-repository ppa:chris-lea/node.js sudo apt-get update sudo apt-get install nodejs 2. Tried to install yeoman, express, n, yeoman's generators globally and all of them returned the same error > npm ERR! Error: EACCES, symlink '../lib/node_modules/n/bin/n' > npm ERR! { [Error: EACCES, symlink '../lib/node_modules/n/bin/n'] errno: 3, code: 'EACCES', path: '../lib/node_modules/n/bin/n' } > npm ERR! > npm ERR! Please try running this command again as root/Administrator. > npm ERR! System Linux 3.8.0-29-generic > npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "-d" "n" > npm ERR! cwd /home/heberlz > npm ERR! node -v v0.10.20 > npm ERR! npm -v 1.3.11 > npm ERR! path ../lib/node_modules/n/bin/n > npm ERR! code EACCES > npm ERR! errno 3 > npm ERR! stack Error: EACCES, symlink '../lib/node_modules/n/bin/n' > npm ERR! > npm ERR! Additional logging details can be found in: > npm ERR! /home/heberlz/npm-debug.log > npm ERR! not ok code 0 3. **Reclaimed ownership of the following folders recursively** ~/.npm, /usr/lib/node, /usr/lib/node_modules, and of the following symlinks /usr/bin/node, /usr/bin/nodejs **with absolutely no success** I need to install yeoman and its generators without sudo not to be in trouble later on :(

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base