npm install errors out #34

Closed
Mulemister opened this Issue Dec 15, 2010 · 4 comments

3 participants

@Mulemister

I tried installing libxmljs via npm an ran into an error:

mobius:libxmljs dave$ npm install libxmljs
npm info it worked if it ends with ok
npm info using npm@0.2.10-1
npm info using node@v0.3.2-pre
npm info preinstall libxmljs@0.4.1
make: scons: Command not found
make: *** [node] Error 127
npm info libxmljs@0.4.1 Failed to exec preinstall script
npm ERR! install failed Error: libxmljs@0.4.1 preinstall: make node
npm ERR! install failed sh failed with 2
npm ERR! install failed at ChildProcess. (/usr/local/lib/node/.npm/npm/0.2.10-1/package/lib/utils/exec.js:24:18)
npm ERR! install failed at ChildProcess.emit (events.js:34:17)
npm ERR! install failed at ChildProcess.onexit (child_process.js:164:12)
npm info install failed rollback
npm info uninstall [ 'libxmljs@0.4.1' ]
npm info preuninstall libxmljs@0.4.1
make: scons: Command not found
make: *** [clean] Error 127
npm ERR! libxmljs@0.4.1.preuninstall Error: sh failed with 2
npm ERR! libxmljs@0.4.1.preuninstall at ChildProcess. (/usr/local/lib/node/.npm/npm/0.2.10-1/package/lib/utils/exec.js:24:18)
npm ERR! libxmljs@0.4.1.preuninstall at ChildProcess.emit (events.js:34:17)
npm ERR! libxmljs@0.4.1.preuninstall at ChildProcess.onexit (child_process.js:164:12)
npm ERR! libxmljs@0.4.1.preuninstall failed, but continuing anyway
npm ERR! rollback failed Error: sh failed with 2
npm ERR! rollback failed at ChildProcess. (/usr/local/lib/node/.npm/npm/0.2.10-1/package/lib/utils/exec.js:24:18)
npm ERR! rollback failed at ChildProcess.emit (events.js:34:17)
npm ERR! rollback failed at ChildProcess.onexit (child_process.js:164:12)
npm ERR! Error: libxmljs@0.4.1 preinstall: make node
npm ERR! sh failed with 2
npm ERR! at ChildProcess. (/usr/local/lib/node/.npm/npm/0.2.10-1/package/lib/utils/exec.js:24:18)
npm ERR! at ChildProcess.emit (events.js:34:17)
npm ERR! at ChildProcess.onexit (child_process.js:164:12)
npm ERR!
npm ERR! Failed at the libxmljs@0.4.1 preinstall script.
npm ERR! This is most likely a problem with the libxmljs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! make node
npm ERR! You can get their info via:
npm ERR! npm owner ls libxmljs
npm ERR! There may be additional logging output above.
npm not ok
mobius:libxmljs dave$

Any ideas on what's going on here? I think it's an issue with "scons".

Thanks,
Dave

@polotek

Sorry about that. A few people have run into it. Libxmljs requires the scons python build library in order to install.

http://www.scons.org/

It's usually easily installed via whatever package os package manage is available to you (macports, yum, apt-get, etc). I added scons to the requirements on the wiki page but not the front page README. I'll do that this evening.

Be sure to send issues if you run into issues with the lib.

:Marco

@Mulemister

Thanks Marco! I installed scons and passed the --standalone-lib flag. Everything installed just fine

https://gist.github.com/742622

I totally missed the wiki and should have looked there first. Apologies about that, but thanks for setting me straight! :)

-Dave

@intool

Hi,
I had a similar issue when trying to install libxmljs via npm:

npm install libxmljs

libxmljs@0.4.2 preinstall /home/user/grpwnd/node_modules/libxmljs
make node

make: scons: Command not found
make: *** [node] Error 127
npm ERR! error installing libxmljs@0.4.2 Error: libxmljs@0.4.2 preinstall: make node
npm ERR! error installing libxmljs@0.4.2 sh "-c" "make node" failed with 2
npm ERR! error installing libxmljs@0.4.2 at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/exec.js:49:20)
npm ERR! error installing libxmljs@0.4.2 at ChildProcess.emit (events.js:67:17)
npm ERR! error installing libxmljs@0.4.2 at ChildProcess.onexit (child_process.js:246:12)

libxmljs@0.4.2 preuninstall /home/user/grpwnd/node_modules/libxmljs
make clean

make: scons: Command not found
make: *** [clean] Error 127
npm ERR! error rolling back libxmljs@0.4.2 Error: libxmljs@0.4.2 preuninstall: make clean
npm ERR! error rolling back libxmljs@0.4.2 sh "-c" "make clean" failed with 2
npm ERR! error rolling back libxmljs@0.4.2 at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/exec.js:49:20)
npm ERR! error rolling back libxmljs@0.4.2 at ChildProcess.emit (events.js:67:17)
npm ERR! error rolling back libxmljs@0.4.2 at ChildProcess.onexit (child_process.js:246:12)
npm ERR! libxmljs@0.4.2 preinstall: make node
npm ERR! sh "-c" "make node" failed with 2
npm ERR!
npm ERR! Failed at the libxmljs@0.4.2 preinstall script.
npm ERR! This is most likely a problem with the libxmljs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! make node
npm ERR! You can get their info via:
npm ERR! npm owner ls libxmljs
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Linux 2.6.32-5-686
npm ERR! command "node" "/usr/local/bin/npm" "install" "libxmljs"
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/user/grpwnd/npm-debug.log
npm not ok

Solved by installing Scons:

$ wget http://sourceforge.net/projects/scons/files/scons/2.0.1/scons-2.0.1.tar.gz/download
$  tar xvf scons-2.0.1.tar.gz
$ cd scons-2.0.1
$ sudo python setup.py install --standalone-lib

Result:

Installed SCons library modules into /usr/local/lib/scons
Installed SCons scripts into /usr/local/bin
Installed SCons man pages into /usr/local/man/man1

Now [try] install libxmljs via npm:

$ npm install libxmljs

FAIL

Error:

$ npm install libxmljs

libxmljs@0.4.2 preinstall /home/user/grpwnd/node_modules/libxmljs
make node

scons: Reading SConscript files ...
OSError: [Errno 2] No such file or directory:
File "/home/user/grpwnd/node_modules/libxmljs/SConstruct", line 43:
cflags = shellOut([xml2config, '--cflags'])
File "/home/user/grpwnd/node_modules/libxmljs/SConstruct", line 19:
return subprocess.Popen(target, stdout=subprocess.PIPE).communicate()[0].strip()
File "/usr/lib/python2.6/subprocess.py", line 623:
errread, errwrite)
File "/usr/lib/python2.6/subprocess.py", line 1141:
raise child_exception
make: *** [node] Error 2
npm ERR! error installing libxmljs@0.4.2 Error: libxmljs@0.4.2 preinstall: make node
npm ERR! error installing libxmljs@0.4.2 sh "-c" "make node" failed with 2
npm ERR! error installing libxmljs@0.4.2 at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/exec.js:49:20)
npm ERR! error installing libxmljs@0.4.2 at ChildProcess.emit (events.js:67:17)
npm ERR! error installing libxmljs@0.4.2 at ChildProcess.onexit (child_process.js:246:12)

libxmljs@0.4.2 preuninstall /home/user/grpwnd/node_modules/libxmljs
make clean

scons: Reading SConscript files ...
OSError: [Errno 2] No such file or directory:
File "/home/user/grpwnd/node_modules/libxmljs/SConstruct", line 43:
cflags = shellOut([xml2config, '--cflags'])
File "/home/user/grpwnd/node_modules/libxmljs/SConstruct", line 19:
return subprocess.Popen(target, stdout=subprocess.PIPE).communicate()[0].strip()
File "/usr/lib/python2.6/subprocess.py", line 623:
errread, errwrite)
File "/usr/lib/python2.6/subprocess.py", line 1141:
raise child_exception
make: *** [clean] Error 2
npm ERR! error rolling back libxmljs@0.4.2 Error: libxmljs@0.4.2 preuninstall: make clean
npm ERR! error rolling back libxmljs@0.4.2 sh "-c" "make clean" failed with 2
npm ERR! error rolling back libxmljs@0.4.2 at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/exec.js:49:20)
npm ERR! error rolling back libxmljs@0.4.2 at ChildProcess.emit (events.js:67:17)
npm ERR! error rolling back libxmljs@0.4.2 at ChildProcess.onexit (child_process.js:246:12)
npm ERR! libxmljs@0.4.2 preinstall: make node
npm ERR! sh "-c" "make node" failed with 2
npm ERR!
npm ERR! Failed at the libxmljs@0.4.2 preinstall script.
npm ERR! This is most likely a problem with the libxmljs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! make node
npm ERR! You can get their info via:
npm ERR! npm owner ls libxmljs
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Linux 2.6.32-5-686
npm ERR! command "node" "/usr/local/bin/npm" "install" "libxmljs"
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/user/grpwnd/npm-debug.log
npm not ok

Please enlighten.
Thanks.

@polotek

The xml2-config utility comes with libxml2. The libxmljs build script uses it to get compile flags and include dirs. It needs to be in your path when you run make. Also try npm --loglevel error ... to cut down on the cruft output and see which part of the output is actually relevant. If this doesn't fix it, please open a new ticket with more specific and helpful info including your OS, node, npm and libxmljs versions. Thanks

:Marco

@polotek polotek closed this Jun 6, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment