pm2 icon indicating copy to clipboard operation
pm2 copied to clipboard

Can't install pm2 at centos6

Open kelvinlee opened this issue 12 years ago • 17 comments

OSError: [Errno 13] Permission denied
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:337:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Linux 2.6.32-042stab083.2
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/pm2/node_modules/usage
gyp ERR! node -v v0.10.24
gyp ERR! node-gyp -v v0.12.1
gyp ERR! not ok 
npm http GET https://registry.npmjs.org/keypress
npm http 200 https://registry.npmjs.org/keypress
npm http GET https://registry.npmjs.org/keypress/-/keypress-0.1.0.tgz
npm http 200 https://registry.npmjs.org/keypress/-/keypress-0.1.0.tgz
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the usage package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls usage
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 2.6.32-042stab083.2
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "pm2" "-g"
npm ERR! cwd /usr/src/node-v0.10.24
npm ERR! node -v v0.10.24
npm ERR! npm -v 1.3.21
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR! /usr/src/node-v0.10.24/npm-debug.log
npm ERR! not ok code 0

I have no idea about this , so how to fix this?

ty.

kelvinlee avatar Dec 25 '13 10:12 kelvinlee

I can't install pm2 on Centos6 either:

[email protected] install /usr/lib/node_modules/pm2/node_modules/usage node-gyp rebuild

npm http 304 https://registry.npmjs.org/keypress Traceback (most recent call last): File "/usr/lib/node_modules/node-gyp/gyp/gyp_main.py", line 18, in sys.exit(gyp.script_main()) AttributeError: 'module' object has no attribute 'script_main' gyp ERR! configure error gyp ERR! stack Error: gyp failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (/usr/lib/node_modules/node-gyp/lib/configure.js:337:16) gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:12) gyp ERR! System Linux 3.11.6-x86_64-linode35 gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /usr/lib/node_modules/pm2/node_modules/usage gyp ERR! node -v v0.10.22 gyp ERR! node-gyp -v v0.12.2 gyp ERR! not ok npm ERR! weird error 1 npm ERR! not ok code 0

The gyp install looked like this:

...

npm http 304 https://registry.npmjs.org/hoek /usr/bin/node-gyp -> /usr/lib/node_modules/node-gyp/bin/node-gyp.js npm WARN unmet dependency /usr/lib/node_modules/block-stream requires inherits@'~2.0.0' but will load npm WARN unmet dependency undefined, npm WARN unmet dependency which is version undefined npm WARN unmet dependency /usr/lib/node_modules/fstream requires inherits@'~2.0.0' but will load npm WARN unmet dependency undefined, npm WARN unmet dependency which is version undefined npm WARN unmet dependency /usr/lib/node_modules/fstream-ignore requires inherits@'2' but will load npm WARN unmet dependency undefined, npm WARN unmet dependency which is version undefined npm WARN unmet dependency /usr/lib/node_modules/fstream-npm requires inherits@'2' but will load npm WARN unmet dependency undefined, npm WARN unmet dependency which is version undefined npm WARN unmet dependency /usr/lib/node_modules/glob requires inherits@'2' but will load npm WARN unmet dependency undefined, npm WARN unmet dependency which is version undefined npm WARN unmet dependency /usr/lib/node_modules/npmconf requires inherits@'~2.0.0' but will load npm WARN unmet dependency undefined, npm WARN unmet dependency which is version undefined npm WARN unmet dependency /usr/lib/node_modules/tar requires inherits@'2' but will load npm WARN unmet dependency undefined, npm WARN unmet dependency which is version undefined [email protected] /usr/lib/node_modules/node-gyp ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ([email protected]) ├── [email protected] ├── [email protected] ([email protected]) ├── [email protected] ([email protected]) ├── [email protected] ([email protected], [email protected]) ├── [email protected] ([email protected]) ├── [email protected] ([email protected], [email protected]) └── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

ransomweaver avatar Dec 26 '13 22:12 ransomweaver

Same problem. Seems that problem with 'usage' module. You can track issue here: arunoda/node-usage/issues/19

olostan avatar Dec 27 '13 03:12 olostan

Try to downgrade you system python to python2.6. It worked for me on ubuntu.

avaranovich avatar Jan 14 '14 13:01 avaranovich

For the OSError: [Errno 13] Permission denied maybe you can try npm install -g pm2@latest --unsafe-perm

Unitech avatar Jan 14 '14 18:01 Unitech

There is a simple workaround to get pm2 working on CentOS 6.4 please see my final comment posted today at https://github.com/arunoda/node-usage/issues/19

workingmatt avatar Jan 23 '14 12:01 workingmatt

Did that, the problem remains.

MariusStuparu avatar Jan 24 '14 12:01 MariusStuparu

@workingmatt That worked for me.

OscarBarrett avatar Jan 28 '14 05:01 OscarBarrett

@Unitech is it possible to install pm2 globaly from this git repo? I mean, after cloning it into ~/npm/lib/node_modules and doing npm install and making a symlink to ~/npm/bin, what else should I do to make it work?

This is a very annoying error from the gyp module. I have even tried re-installing the python gyp module, and still doesn't work.

MariusStuparu avatar Feb 03 '14 16:02 MariusStuparu

is it possible to install pm2 globaly from this git repo?

npm install -g Unitech/pm2

No idea if it works, but npm itself seems to be installable just fine this way (source).

rlidwka avatar Feb 03 '14 20:02 rlidwka

@mariusstuparu the -g flag @rlidwka suggests should work. Did you read my post I linked to 11 days ago above? It shows how I got pm2 to install globally and get over the node-gyp fault

workingmatt avatar Feb 03 '14 20:02 workingmatt

@rlidwka It doesn't, it stops at the same node-gyp error. @workingmatt I tried it, the same

MariusStuparu avatar Feb 03 '14 21:02 MariusStuparu

How about this? When I upgrade my node.js and pm2, this is worked for me.

1.install rpm(my centos needs this) libstdc++-devel-4.4.7-4.el6.x86_64, gcc-c++-4.4.7-4.el6.x86_64

2.rebuild node-gyp {shell}>"node" "{installed node.js path}/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"

mob-hyunmin avatar Feb 04 '14 03:02 mob-hyunmin

Something did the trick, because now it installed with --unsafe-perm, but only after I erased all traces of Node and Npm, and installed it again from source. Maybe the Yum packages are corrupt somehow.

MariusStuparu avatar Feb 04 '14 08:02 MariusStuparu

[email protected] installs fine, [email protected] fails... any update on this?

rlidwka avatar Feb 12 '14 01:02 rlidwka

this seem to be fixing it.

rlidwka avatar Feb 28 '14 11:02 rlidwka

I managed to fix this for my install.

Few notes:

  • CentOS 6.4
  • Linode Box, kernel, etc
  • node 0.10.26 (installed using EPEL)
  • npm 1.3.6 (installed using EPEL)

Relevant error:

...
make: Entering directory `/usr/lib/node_modules/pm2/node_modules/usage/build'
  CXX(target) Release/obj.target/sysinfo/src/binding.o
  SOLINK_MODULE(target) Release/obj.target/sysinfo.node
  SOLINK_MODULE(target) Release/obj.target/sysinfo.node: Finished
  COPY Release/sysinfo.node
make: Leaving directory `/usr/lib/node_modules/pm2/node_modules/usage/build'
/usr/bin/pm2 -> /usr/lib/node_modules/pm2/bin/pm2
npm WARN unmet dependency /usr/lib/node_modules/block-stream requires inherits@'~2.0.0' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency /usr/lib/node_modules/fstream requires inherits@'~2.0.0' but will load
npm WARN unmet dependency undefined,
...

What i discovered is that EPEL repo uses inherits@2 directory and symlinks inherits to it under /usr/lib/node_modules

Here's what I had to do to fix this:

$ cd /usr/lib/node_modules
$ unlink inherits
$ rm -rf inherits\@2/
$ npm install -g inherits

Running npm install -g pm2 proceeded without further issues.

I imagine this breaks yum update in the future.

smazurov avatar Mar 24 '14 22:03 smazurov

As of https://github.com/Unitech/pm2/commit/1bedf104976702afd9e2aadc7d0a9c0bc3d1a847 there is no C bindings anymore, this should work but I'd be glad to have a confirmation! Thanks.

soyuka avatar May 11 '14 17:05 soyuka