isaacs/npm — Issue #2014: error log trying to install express
Author: luface2000
Created: 2012-01-09 19:46:34+00:00
State: open

Hello,

work with debian testing repositories pointing to testing. I installed node, and express npm following some tutorials and I made some mistakes by not paying attention.

1.- First I did the following as root:

https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manag ...

# echo sid main deb http://ftp.us.debian.org/debian/> /etc/apt/sources.list.d/sid.list
# apt-get update
# apt-get install nodejs # Documentation is great.
# node-v v0.4.12

2.- You should then have done the following http://www.freshblurbs.com/install-node-js-and-express-js-nginx-debian-lenny:

$ cd
$ curl http://npmjs.org/install.sh | sh
$ which npm
but rather as a user I did not realize and what I did as root and it did not change the directory, ie do the following:

# Curl http://npmjs.org/install.sh | sh
# Which npm
/usr/bin/npm

and if I go to that directory permissions are for root, but not whether they should be user.

/usr/bin $ ls-la npm
lrwxrwxrwx 1 root root 38 Jan 7 20:09 npm -> .. /lib/node_modules/npm/bin/npm-cli.js

3.- In making the last step could http://expressjs.com/guide.html:

$ npm express install
$ express /tmp/foo&&cd/tmp/foo

or this to install for global

$ npm install-g express
$ express /tmp/foo&&cd/tmp/foo

and did the first, but when attempting the second with

$ npm install-g express

I get these errors

$ npm install-g express
npm ERR! Could not create / usr / lib / node_modules / ___express.npm
npm ERR! Error installing express@2.5.4 Error: EACCES, Permission denied '/ usr / lib / node_modules / ___express.npm'
npm ERR! Error: EACCES, Permission denied '/ usr / lib / node_modules / ___express.npm'
npm ERR! Report this * Entire * log at:
npm ERR!
npm ERR! or email it to:
npm ERR!
npm ERR!
npm ERR! System Linux 3.0.0-1-amd64
npm ERR! command "node" "/usr/bin/npm" "install" "-g" "express"
npm ERR! cwd /home/luis
npm ERR! node-v v0.4.12
npm ERR! npm-v 1.0.106
npm ERR! path/usr/lib/node_modules/___express.npm
npm ERR! EACCES code
npm ERR!
npm ERR! Additional logging Can be found in details:
npm ERR! /home/luis/npm-debug.log
npm not ok
Total I have a major mess, as there are in that situation I am.

I tested with this as helloworld.js node

var sys = require ('sys');
sys.puts ('Hello World');
and making a

$ Node helloworld.js
Hello World
It works, but I want to install Express to develop.

Is it a problem to install it as root?

Can you help me?