Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm install fails on Solaris (SmartOS) #100

Closed
goldfire opened this issue Jan 25, 2012 · 22 comments
Closed

npm install fails on Solaris (SmartOS) #100

goldfire opened this issue Jan 25, 2012 · 22 comments

Comments

@goldfire
Copy link

It installed fine on my Macbook Pro with node v0.6.6, but when I try to deploy it fails with the following. Any ideas what could be causing this?

npm ERR! libxmljs@0.5.0 install: `node-waf configure build`
npm ERR! `sh "-c" "node-waf configure build"` failed with 1
npm ERR! 
npm ERR! Failed at the libxmljs@0.5.0 install 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!     node-waf configure build
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 SunOS 5.11
npm ERR! command "node" "/home/node/local/nodejs/bin/npm" "install" "--link" "--node-version" "v0.6.6"
npm ERR! cwd /home/node/node-service/releases/2012-01-25T06-37-48.748009533
npm ERR! node -v v0.6.6
npm ERR! npm -v 1.1.0-beta-4
npm ERR! code ELIFECYCLE
npm ERR! message libxmljs@0.5.0 install: `node-waf configure build`
npm ERR! message `sh "-c" "node-waf configure build"` failed with 1
@polotek
Copy link
Collaborator

polotek commented Jan 25, 2012

If I remember correctly, solaris/joyent doesn't have libxml2 installed in any of the usual place. Would you mind finding out if the lib is installed and if so, what's the path to the include files?

@goldfire
Copy link
Author

It was not installed by default, but I installed it with pkgin in libxml2 and it was installed in /usr/include/libxml2/libxml.

@goldfire
Copy link
Author

I tried installing libxmljs directly instead of as a dependency for another module and was able to get what appears to be a more informative set of error messages:

> libxmljs@0.5.0 install /home/node/local/lib/node_modules/libxmljs
> node-waf configure build

Checking for program g++ or c++          : /opt/local/bin/g++ 
Checking for program cpp                 : /opt/local/bin/cpp 
Checking for program ar                  : /opt/local/bin/ar 
Checking for program ranlib              : /opt/local/bin/ranlib 
Checking for g++                         : ok  
Checking for node path                   : not found 
Checking for node prefix                 : ok /opt/nodejs/v0.6.6 
Checking for program xml2-config         : /opt/local/bin/xml2-config 
'configure' finished successfully (0.176s)
Waf: Entering directory `/home/node/local/lib/node_modules/libxmljs/build'
[ 1/10] cxx: src/libxmljs.cc -> build/Release/src/libxmljs_1.o
[ 2/10] cxx: src/xml_attribute.cc -> build/Release/src/xml_attribute_1.o
[ 3/10] cxx: src/xml_document.cc -> build/Release/src/xml_document_1.o
[ 4/10] cxx: src/xml_element.cc -> build/Release/src/xml_element_1.o
[ 5/10] cxx: src/xml_namespace.cc -> build/Release/src/xml_namespace_1.o
[ 6/10] cxx: src/xml_node.cc -> build/Release/src/xml_node_1.o
[ 7/10] cxx: src/xml_sax_parser.cc -> build/Release/src/xml_sax_parser_1.o
../src/libxmljs.cc:5:30: fatal error: libxml/xmlmemory.h: No such file or directory
compilation terminated.
[ 8/10] cxx: src/xml_syntax_error.cc -> build/Release/src/xml_syntax_error_1.o
In file included from ../src/xml_syntax_error.cc:5:0:
../src/xml_syntax_error.h:5:29: fatal error: libxml/xmlerror.h: No such file or directory
compilation terminated.
In file included from ../src/xml_element.h:6:0,
                 from ../src/xml_attribute.h:6,
                 from ../src/xml_attribute.cc:2:
../src/xml_node.h:5:25: fatal error: libxml/tree.h: No such file or directory
compilation terminated.
../src/xml_document.cc:5:31: fatal error: libxml/HTMLparser.h: No such file or directory
compilation terminated.
../src/xml_node.cc:5:28: fatal error: libxml/xmlsave.h: No such file or directory
compilation terminated.
In file included from ../src/xml_namespace.cc:5:0:
../src/xml_namespace.h:7:25: fatal error: libxml/tree.h: No such file or directory
compilation terminated.
In file included from ../src/xml_element.h:6:0,
                 from ../src/xml_element.cc:9:
../src/xml_node.h:5:25: fatal error: libxml/tree.h: No such file or directory
compilation terminated.
../src/xml_sax_parser.cc:5:36: fatal error: libxml/parserInternals.h: No such file or directory
compilation terminated.
Waf: Leaving directory `/home/node/local/lib/node_modules/libxmljs/build'
Build failed:
 -> task failed (err #1): 
        {task: cxx libxmljs.cc -> libxmljs_1.o}
 -> task failed (err #1): 
        {task: cxx xml_syntax_error.cc -> xml_syntax_error_1.o}
 -> task failed (err #1): 
        {task: cxx xml_attribute.cc -> xml_attribute_1.o}
 -> task failed (err #1): 
        {task: cxx xml_document.cc -> xml_document_1.o}
 -> task failed (err #1): 
        {task: cxx xml_node.cc -> xml_node_1.o}
 -> task failed (err #1): 
        {task: cxx xml_namespace.cc -> xml_namespace_1.o}
 -> task failed (err #1): 
        {task: cxx xml_element.cc -> xml_element_1.o}
 -> task failed (err #1): 
        {task: cxx xml_sax_parser.cc -> xml_sax_parser_1.o}
npm ERR! error installing libxmljs@0.5.0

> libxmljs@0.5.0 preuninstall /home/node/local/lib/node_modules/libxmljs
> node-waf clean

'clean' finished successfully (0.024s)
npm ERR! libxmljs@0.5.0 install: `node-waf configure build`
npm ERR! `sh "-c" "node-waf configure build"` failed with 1
npm ERR! 
npm ERR! Failed at the libxmljs@0.5.0 install 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!     node-waf configure build
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 SunOS 5.11
npm ERR! command "node" "/home/node/local/nodejs/bin/npm" "install" "libxmljs"
npm ERR! cwd /home/node/node-service/releases
npm ERR! node -v v0.6.6
npm ERR! npm -v 1.1.0-beta-4
npm ERR! code ELIFECYCLE
npm ERR! message libxmljs@0.5.0 install: `node-waf configure build`
npm ERR! message `sh "-c" "node-waf configure build"` failed with 1
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/node/node-service/releases/npm-debug.log

@defunctzombie
Copy link
Collaborator

Can you tell me what the output of the following command gives on that machine?

xml2-config --cflags

Also, what version of libxml2 is being installed?

@goldfire
Copy link
Author

-I/opt/local/include/libxml2 -I/opt/local/include

Version 2.7.8 is installed.

@defunctzombie
Copy link
Collaborator

@goldfire and what does

ls -la /opt/local/include/libxml2

Give you? I believe that however libxml2 was installed was not quite right.

@goldfire
Copy link
Author

total 7
drwxr-xr-x  3 root root  3 2012-01-26 01:43 .
drwxr-xr-x 12 root root 49 2012-01-26 01:51 ..
drwxr-xr-x  2 root root 49 2012-01-26 01:43 libxml

@defunctzombie
Copy link
Collaborator

@goldfire sorry, I forgot to request a recursive ls

ls -laR /opt/local/include/libxml2

I would like to see if the header files are actually in the location they are supposed to be in.

Is there a way for me to reproduce this issue on an instance? Can you provide access or does joyent have free instances I can test on?

@goldfire
Copy link
Author

/opt/local/include/libxml2:
total 7
drwxr-xr-x  3 root root  3 2012-01-26 01:43 .
drwxr-xr-x 12 root root 49 2012-01-26 01:51 ..
drwxr-xr-x  2 root root 49 2012-01-26 01:43 libxml

/opt/local/include/libxml2/libxml:
total 454
drwxr-xr-x 2 root root    49 2012-01-26 01:43 .
drwxr-xr-x 3 root root     3 2012-01-26 01:43 ..
-rw-r--r-- 1 root root  3110 2011-07-20 20:01 c14n.h
-rw-r--r-- 1 root root  4958 2011-07-20 20:01 catalog.h
-rw-r--r-- 1 root root  5159 2011-07-20 20:01 chvalid.h
-rw-r--r-- 1 root root  5181 2011-07-20 20:01 debugXML.h
-rw-r--r-- 1 root root  1582 2011-07-20 20:01 dict.h
-rw-r--r-- 1 root root  3277 2011-07-20 20:01 DOCBparser.h
-rw-r--r-- 1 root root  8359 2011-07-20 20:01 encoding.h
-rw-r--r-- 1 root root  4672 2011-07-20 20:01 entities.h
-rw-r--r-- 1 root root 14651 2011-07-20 20:01 globals.h
-rw-r--r-- 1 root root  6567 2011-07-20 20:01 hash.h
-rw-r--r-- 1 root root  9372 2011-07-20 20:01 HTMLparser.h
-rw-r--r-- 1 root root  3685 2011-07-20 20:01 HTMLtree.h
-rw-r--r-- 1 root root  3422 2011-07-20 20:01 list.h
-rw-r--r-- 1 root root  3739 2011-07-20 20:01 nanoftp.h
-rw-r--r-- 1 root root  2018 2011-07-20 20:01 nanohttp.h
-rw-r--r-- 1 root root 39578 2011-07-20 20:01 parser.h
-rw-r--r-- 1 root root 16573 2011-07-20 20:01 parserInternals.h
-rw-r--r-- 1 root root  2586 2011-07-20 20:01 pattern.h
-rw-r--r-- 1 root root  5958 2011-07-20 20:01 relaxng.h
-rw-r--r-- 1 root root  4412 2011-07-20 20:01 SAX.h
-rw-r--r-- 1 root root  4944 2011-07-20 20:01 SAX2.h
-rw-r--r-- 1 root root 26023 2011-07-20 20:01 schemasInternals.h
-rw-r--r-- 1 root root  4393 2011-07-20 20:01 schematron.h
-rw-r--r-- 1 root root  1852 2011-07-20 20:01 threads.h
-rw-r--r-- 1 root root 36628 2011-07-20 20:01 tree.h
-rw-r--r-- 1 root root  2664 2011-07-20 20:01 uri.h
-rw-r--r-- 1 root root 13818 2011-07-20 20:01 valid.h
-rw-r--r-- 1 root root  2967 2011-07-20 20:01 xinclude.h
-rw-r--r-- 1 root root  5051 2011-07-20 20:01 xlink.h
-rw-r--r-- 1 root root  3992 2011-07-20 20:01 xmlautomata.h
-rw-r--r-- 1 root root 36676 2011-07-20 20:01 xmlerror.h
-rw-r--r-- 1 root root  3914 2011-07-20 20:01 xmlexports.h
-rw-r--r-- 1 root root 10448 2011-07-20 20:01 xmlIO.h
-rw-r--r-- 1 root root  5945 2011-07-20 20:01 xmlmemory.h
-rw-r--r-- 1 root root  1171 2011-07-20 20:01 xmlmodule.h
-rw-r--r-- 1 root root 12551 2011-07-20 20:01 xmlreader.h
-rw-r--r-- 1 root root  5458 2011-07-20 20:01 xmlregexp.h
-rw-r--r-- 1 root root  2337 2011-07-20 20:01 xmlsave.h
-rw-r--r-- 1 root root  6202 2011-07-20 20:01 xmlschemas.h
-rw-r--r-- 1 root root  4893 2011-07-20 20:01 xmlschemastypes.h
-rw-r--r-- 1 root root  5472 2011-07-20 20:01 xmlstring.h
-rw-r--r-- 1 root root  9993 2011-07-20 20:01 xmlunicode.h
-rw-r--r-- 1 root root  7747 2011-07-20 20:01 xmlversion.h
-rw-r--r-- 1 root root 21159 2011-07-20 20:01 xmlwriter.h
-rw-r--r-- 1 root root 16199 2011-07-20 20:01 xpath.h
-rw-r--r-- 1 root root 19448 2011-07-20 20:01 xpathInternals.h
-rw-r--r-- 1 root root  3411 2011-07-20 20:01 xpointer.h

I'm running one of their paid Node.js instances that can only be logged into with an SSH key. The free instances at http://no.de are essentially the same thing, so it should reproduce the issue.

@defunctzombie
Copy link
Collaborator

@goldfire I fired up a free no.de instance. npm does not work out of the box. How are you installing libxmljs?

@goldfire
Copy link
Author

Did you login to use node?

@defunctzombie
Copy link
Collaborator

@goldfire Yes, I followed the ssh instructions on the no.de website. Node works, npm does not. Regardless, I cloned the repo and did a simple 'make' and it built just fine. So the problem is with some other setup you have going on and not the package failing to build. As a note, the xml2-config app I have installed reported being located in /usr/bin/xml2-config and not in /opt

@goldfire
Copy link
Author

@shtylman I guess the no.de setup is different from the paid ones. I get the following when I clone the repo and try what you said:

node-waf configure
gmake: node-waf: Command not found
gmake: *** [build/] Error 127

or with make

node-waf configure
make: node-waf: Command not found
make: *** [build/] Error 127

@defunctzombie
Copy link
Collaborator

@goldfire you need to make sure that node-waf is in your PATH.

@goldfire
Copy link
Author

Oh right, forgot I had logged into a different user. I still get this when installing from source instead of npm:

node-waf configure
Checking for program g++ or c++          : /opt/local/bin/g++ 
Checking for program cpp                 : /opt/local/bin/cpp 
Checking for program ar                  : /opt/local/bin/ar 
Checking for program ranlib              : /opt/local/bin/ranlib 
Checking for g++                         : ok  
Checking for node path                   : not found 
Checking for node prefix                 : ok /opt/nodejs/v0.6.6 
Checking for program xml2-config         : /opt/local/bin/xml2-config 
'configure' finished successfully (0.189s)
node-waf build
Waf: Entering directory `/libxmljs/libxmljs/build'
[ 1/10] cxx: src/libxmljs.cc -> build/Release/src/libxmljs_1.o
[ 2/10] cxx: src/xml_attribute.cc -> build/Release/src/xml_attribute_1.o
[ 3/10] cxx: src/xml_document.cc -> build/Release/src/xml_document_1.o
[ 4/10] cxx: src/xml_element.cc -> build/Release/src/xml_element_1.o
[ 5/10] cxx: src/xml_namespace.cc -> build/Release/src/xml_namespace_1.o
[ 6/10] cxx: src/xml_node.cc -> build/Release/src/xml_node_1.o
[ 7/10] cxx: src/xml_sax_parser.cc -> build/Release/src/xml_sax_parser_1.o
../src/libxmljs.cc:5:30: fatal error: libxml/xmlmemory.h: No such file or directory
compilation terminated.
In file included from ../src/xml_element.h:6:0,
                 from ../src/xml_attribute.h:6,
                 from ../src/xml_attribute.cc:2:
../src/xml_node.h:5:25: fatal error: libxml/tree.h: No such file or directory
compilation terminated.
../src/xml_document.cc:5:31: fatal error: libxml/HTMLparser.h: No such file or directory
compilation terminated.
In file included from ../src/xml_namespace.cc:5:0:
../src/xml_namespace.h:7:25: fatal error: libxml/tree.h: No such file or directory
compilation terminated.
../src/xml_sax_parser.cc:5:36: fatal error: libxml/parserInternals.h: No such file or directory
compilation terminated.
In file included from ../src/xml_element.h:6:0,
                 from ../src/xml_element.cc:9:
../src/xml_node.h:5:25: fatal error: libxml/tree.h: No such file or directory
compilation terminated.
../src/xml_node.cc:5:28: fatal error: libxml/xmlsave.h: No such file or directory
compilation terminated.
Waf: Leaving directory `/libxmljs/libxmljs/build'
Build failed:
 -> task failed (err #1): 
        {task: cxx libxmljs.cc -> libxmljs_1.o}
 -> task failed (err #1): 
        {task: cxx xml_attribute.cc -> xml_attribute_1.o}
 -> task failed (err #1): 
        {task: cxx xml_document.cc -> xml_document_1.o}
 -> task failed (err #1): 
        {task: cxx xml_namespace.cc -> xml_namespace_1.o}
 -> task failed (err #1): 
        {task: cxx xml_sax_parser.cc -> xml_sax_parser_1.o}
 -> task failed (err #1): 
        {task: cxx xml_element.cc -> xml_element_1.o}
 -> task failed (err #1): 
        {task: cxx xml_node.cc -> xml_node_1.o}
gmake: *** [build/Release/libxmljs.node] Error 1

@defunctzombie
Copy link
Collaborator

@goldfire can you do the build with

 node-waf build --verbose

And pastbin the result. Your environment is radically different than the one my instance had.

@goldfire
Copy link
Author

@defunctzombie
Copy link
Collaborator

@goldfire Please try the latest master branch. It should resolve the problem.

@goldfire
Copy link
Author

Amazing, it works! I can't thank you enough. Is there any chance that fix will make it into npm anytime soon?

@defunctzombie
Copy link
Collaborator

@goldfire it is available in npm now

@goldfire
Copy link
Author

I might actually meet my deadline now :) Thank you very much!

@polotek
Copy link
Collaborator

polotek commented Jan 26, 2012

Kickass. It would be nice if we had a CI environment for a bunch of the OSes that people generally deploy node to. It would nice to know when these things break in various environments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants