0

Get into remote ssh via:

rhc ssh <myapp>

Need to intall a module:

npm install koa --save

Gives the result:

npm http GET https://registry.npmjs.org/koa
npm http 304 https://registry.npmjs.org/koa
npm WARN engine koa@0.19.1: wanted: {"node":">= 0.11.16","iojs":">= 1.0.0"} (current: {"node":"v0.11.11","npm":"1.3.25"})
npm ERR! Error: EACCES, mkdir '/var/lib/openshift/55397f875973ca0497xxxxxx/node_modules'
npm ERR!  { [Error: EACCES, mkdir '/var/lib/openshift/55397f875973ca0497xxxxxx/node_modules']
npm ERR!   stack: 'Error: EACCES, mkdir \'/var/lib/openshift/55397f875973ca0497xxxxxx/node_modules\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/var/lib/openshift/55397f875973ca0497xxxxxx/node_modules',
npm ERR!   fstream_type: 'Directory',
npm ERR!   fstream_path: '/var/lib/openshift/55397f875973ca0497xxxxxx/node_modules/koa',
npm ERR!   fstream_class: 'DirWriter',
npm ERR!   fstream_stack: 
npm ERR!    [ '/var/lib/openshift/55397f875973ca0497xxxxxx/app-root/data/node-v0.11.11-linux-x64/lib/node_modules/npm/node_modules/fstream/lib/writer.js:171:23',
npm ERR!      '/var/lib/openshift/55397f875973ca0497xxxxxx/app-root/data/node-v0.11.11-linux-x64/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53',
npm ERR!      'Object.oncomplete (fs.js:97:15)' ] }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.
basickarl
  • 37,187
  • 64
  • 214
  • 335

1 Answers1

-1

The error says it all: Error: "EACCES, mkdir '/var/lib/....'". npm is trying to make a directory with the 'mkdir' command. Normally this needs specific privileges.

Run the npm install with sudo and you should be good to go!

sudo npm install koa --save

Also it is looking for "node":">= 0.11.16","iojs":">= 1.0.0" and you have "node":"v0.11.11"

Try a version manager like so:

sudo npm install n -g
sudo n 0.4.12 // replace with the version you want

or you could specify 'stable' to get the latest stable build:

sudo npm install n -g
sudo n stable
sandeep s
  • 385
  • 2
  • 8