RobeeeJay / libxsltjs

libxslt bindings for v8 javascript engine
3 stars 1 forks source link

Error instaling #2

Open lexblagus opened 10 years ago

lexblagus commented 10 years ago

Error installing libxsltjs on Mac OSX 10.8.5

blagus@quirks:~$ sudo npm install libxsltjs
npm WARN package.json multipart@0.1.5 No repository field.
npm http GET https://registry.npmjs.org/libxsltjs
npm http 304 https://registry.npmjs.org/libxsltjs

> libxsltjs@0.1.2 install /Users/blagus/node_modules/libxsltjs
> node-gyp rebuild

You have not agreed to the Xcode license agreements, please run 'xcodebuild -license' (for user-level acceptance) or 'sudo xcodebuild -license' (for system-wide acceptance) from within a Terminal window to review and agree to the Xcode license agreements.

gyp: Error 69 running xcodebuild
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:424: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 Darwin 12.5.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/blagus/node_modules/libxsltjs
gyp ERR! node -v v0.10.20
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok 
npm ERR! weird error 1
npm ERR! not ok code 0

blagus@quirks:~$ node -v
v0.10.20

blagus@quirks:~$ npm -v
1.3.11
RobeeeJay commented 10 years ago

Alas I don't have a Mac to test on, but I suspect the line that says...

"You have not agreed to the Xcode license agreements, please run 'xcodebuild -license' (for user-level acceptance) or 'sudo xcodebuild -license' (for system-wide acceptance) from within a Terminal window to review and agree to the Xcode license agreements."

...is the problem!

Did you try executing the command as suggested?

sudo xcodebuild -license

Hopefully that will fix the problem.

lexblagus commented 10 years ago

Oh, yes, I should pay attention to that. Sorry about it. After run xcodebuild -license I get:

blagus@quirks:~$ sudo npm install libxsltjs
npm WARN package.json multipart@0.1.5 No repository field.
npm http GET https://registry.npmjs.org/libxsltjs
npm http 304 https://registry.npmjs.org/libxsltjs

> libxsltjs@0.1.2 install /Users/blagus/node_modules/libxsltjs
> node-gyp rebuild

  CXX(target) Release/obj.target/nodexsltjs/src/libxsltjs.o
clang: warning: -lxslt: 'linker' input unused
../src/libxsltjs.cc:1:10: fatal error: 'libxml/HTMLparser.h' file not found
#include <libxml/HTMLparser.h>
         ^
1 error generated.
make: *** [Release/obj.target/nodexsltjs/src/libxsltjs.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
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 Darwin 12.5.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/blagus/node_modules/libxsltjs
gyp ERR! node -v v0.10.20
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok 
npm ERR! weird error 1
npm ERR! not ok code 0
blagus@quirks:~$ 
RobeeeJay commented 10 years ago

Are libxml2 and libxslt installed?

lexblagus commented 10 years ago

Nopes. Here we go:

blagus@quirks:~$ sudo npm install libxml2
npm WARN package.json multipart@0.1.5 No repository field.
npm http GET https://registry.npmjs.org/libxml2
npm http 404 https://registry.npmjs.org/libxml2
npm ERR! 404 'libxml2' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.

npm ERR! System Darwin 12.5.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "libxml2"
npm ERR! cwd /Users/blagus
npm ERR! node -v v0.10.20
npm ERR! npm -v 1.3.11
npm ERR! code E404
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/blagus/npm-debug.log
npm ERR! not ok code 0

blagus@quirks:~$ sudo npm install libxslt
npm WARN package.json multipart@0.1.5 No repository field.
npm http GET https://registry.npmjs.org/libxslt
npm http 404 https://registry.npmjs.org/libxslt
npm ERR! 404 'libxslt' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.

npm ERR! System Darwin 12.5.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "libxslt"
npm ERR! cwd /Users/blagus
npm ERR! node -v v0.10.20
npm ERR! npm -v 1.3.11
npm ERR! code E404
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/blagus/npm-debug.log
npm ERR! not ok code 0
blagus@quirks:~$ 
RobeeeJay commented 10 years ago

Sorry, these aren't node.js modules, they are libraries: http://www.xmlsoft.org/downloads.html

libxsltjs is a (very basic) wrapper for the libxslt library. I found this on google but I have no idea if it will work for you:

sudo port install libxml2 libxslt

lexblagus commented 10 years ago

Same as usual:

blagus@quirks:~$ sudo port install libxml2 libxslt
--->  Computing dependencies for libxml2
--->  Cleaning libxml2
--->  Computing dependencies for libxslt
--->  Cleaning libxslt
--->  Scanning binaries for linking errors: 100.0%
--->  No broken files found.
blagus@quirks:~$ sudo npm install libxsltjs
npm WARN package.json multipart@0.1.5 No repository field.
npm http GET https://registry.npmjs.org/libxsltjs
npm http 304 https://registry.npmjs.org/libxsltjs

> libxsltjs@0.1.2 install /Users/blagus/node_modules/libxsltjs
> node-gyp rebuild

  CXX(target) Release/obj.target/nodexsltjs/src/libxsltjs.o
clang: warning: -lxslt: 'linker' input unused
clang: warning: -lxml2: 'linker' input unused
clang: warning: -lz: 'linker' input unused
clang: warning: -lpthread: 'linker' input unused
clang: warning: -liconv: 'linker' input unused
clang: warning: -lm: 'linker' input unused
../src/libxsltjs.cc:1:10: fatal error: 'libxml/HTMLparser.h' file not found
#include <libxml/HTMLparser.h>
         ^
1 error generated.
make: *** [Release/obj.target/nodexsltjs/src/libxsltjs.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
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 Darwin 12.5.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/blagus/node_modules/libxsltjs
gyp ERR! node -v v0.10.20
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok 
npm ERR! weird error 1
npm ERR! not ok code 0
RobeeeJay commented 10 years ago

Sounds like libxml isn't being found. You could try:

find / -name "HTMLparser.h"

Then whatever directory that is in, edit the include line at the top of /src/libxsltjs.cc so it points to that place directly. (It's probably something like /usr/include/libxml2)

From a quick google, lots of people seem to have issues with libxml2 and xcode, so it's probably a Mac thing. :/

daveoflynn commented 10 years ago

Hey @RobeeeJay , happy to do Mac testing if you need it.

RobeeeJay commented 10 years ago

Does that include the working-out-and-fixing? :)

daveoflynn commented 10 years ago

Maaaaybe? Depends on how tricky it is.

On 23 October 2013 14:00, RobeeeJay notifications@github.com wrote:

Does that include the working-out-and-fixing? :)

— Reply to this email directly or view it on GitHubhttps://github.com/RobeeeJay/libxsltjs/issues/2#issuecomment-26898934 .