0

I already have installed express using

npm install express

but looks like in order too create apps I should install it globally. So I used:

npm install -g express

but received:

npm ERR! Error: EACCES, mkdir '/usr/lib/node_modules/express'
npm ERR!  { [Error: EACCES, mkdir '/usr/lib/node_modules/express']
npm ERR!   errno: 3,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/usr/lib/node_modules/express',
npm ERR!   fstream_type: 'Directory',
npm ERR!   fstream_path: '/usr/lib/node_modules/express',
npm ERR!   fstream_class: 'DirWriter',
npm ERR!   fstream_stack: 
npm ERR!    [ '/usr/lib/node_modules/fstream/lib/dir-writer.js:36:23',
npm ERR!      '/usr/lib/node_modules/mkdirp/index.js:37:53',
npm ERR!      'Object.oncomplete (fs.js:107:15)' ] }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Linux 3.11.2-201.fc19.x86_64
npm ERR! command "node" "/usr/bin/npm" "install" "-g" "express"
npm ERR! cwd /home/parisa
npm ERR! node -v v0.10.19
npm ERR! npm -v 1.3.6
npm ERR! path /usr/lib/node_modules/express
npm ERR! fstream_path /usr/lib/node_modules/express
npm ERR! fstream_type Directory
npm ERR! fstream_class DirWriter
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/usr/lib/node_modules/express'
npm ERR! fstream_stack /usr/lib/node_modules/fstream/lib/dir-writer.js:36:23
npm ERR! fstream_stack /usr/lib/node_modules/mkdirp/index.js:37:53
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/parisa/npm-debug.log
npm ERR! not ok code 0

then after trying sudo:

sudo npm install -g express

I get this:

axconfig: unable to open axports file /etc/ax25/axports (No such file or directory)

why is that???

1
  • 2
    You haven't installed node correctly more than likely. You've installed something called Node, when in fact, you wanted NodeJS. stackoverflow.com/questions/2424346/… Commented Oct 6, 2013 at 16:25

3 Answers 3

3

As the error clearly states, you don't have permissions to create in /usr/lib. stack Error: EACCES, mkdir '/usr/lib/node_modules/express'

hence install with sudo permissions..

sudo npm install -g express
Sign up to request clarification or add additional context in comments.

2 Comments

You should never use sudo with npm!
@MohamedTurki that's debatable. Anyway I don't install packages globally this way, I install via npm install -g express --prefix ~/node_modules. I have all node modules inside ~/node_modules instead of /usr/lib/node_modules.
3

Are you using fedora?

At least in fedora the "node" package is not node.js, It is an amateur radio utility, axconfig is a file of that software.

npm is not finding nodejs, it is trying to use the wrong software.

Install nodejs package

sudo yum install nodejs

and remove node package

sudo yum remove node

Now npm must work properly for the super user.

edit: Also in debian repositories, the package 'node' is not nodejs

Comments

0

If you are on Arch Linux, check out the npm2arch package in the AUR. It will let you install npm packages using pacman.

Example:

npm2archinstall express

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.