bsuh / node_xslt

a simple XSLT addon for node
zlib License
71 stars 17 forks source link

Trouble installing node_xslt #9

Closed boozedog closed 12 years ago

boozedog commented 12 years ago
Davids-MacBook-Pro:node.buser.net david$ npm install node_xslt
npm http GET https://registry.npmjs.org/node_xslt
npm http 304 https://registry.npmjs.org/node_xslt

> node_xslt@0.1.5 preinstall /Users/david/Documents/node.buser.net/node_modules/node_xslt
> node-waf clean || (exit 0); node-waf configure build

Nothing to clean (project not configured)
Checking for program g++ or c++          : /usr/bin/g++ 
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for g++                         : ok  
Checking for node path                   : not found 
Checking for node prefix                 : ok /usr/local 
Checking for library ['xml2', 'xslt']    : yes 
'configure' finished successfully (0.179s)
Waf: Entering directory `/Users/brian/node_xslt/build'
Waf: Leaving directory `/Users/brian/node_xslt/build'
Traceback (most recent call last):
  File "/usr/local/bin/node-waf", line 16, in <module>
    Scripting.prepare(t, os.getcwd(), VERSION, wafdir)
  File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 145, in prepare
    prepare_impl(t, cwd, ver, wafdir)
  File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 135, in prepare_impl
    main()
  File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 188, in main
    fun(ctx)
  File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 386, in build
    return build_impl(bld)
  File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 405, in build_impl
    bld.compile()
  File "/usr/local/bin/../lib/node/wafadmin/Build.py", line 268, in compile
    os.chdir(self.bldnode.abspath())
OSError: [Errno 2] No such file or directory: '/Users/brian/node_xslt/build'
npm ERR! error installing node_xslt@0.1.5

npm ERR! node_xslt@0.1.5 preinstall: `node-waf clean || (exit 0); node-waf configure build`
npm ERR! `sh "-c" "node-waf clean || (exit 0); node-waf configure build"` failed with 1
npm ERR! 
npm ERR! Failed at the node_xslt@0.1.5 preinstall script.
npm ERR! This is most likely a problem with the node_xslt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-waf clean || (exit 0); node-waf configure build
npm ERR! You can get their info via:
npm ERR!     npm owner ls node_xslt
npm ERR! There is likely additional logging output above.
npm ERR! 
npm ERR! System Darwin 11.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "node_xslt"
npm ERR! cwd /Users/david/Documents/node.buser.net
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! code ELIFECYCLE
npm ERR! message node_xslt@0.1.5 preinstall: `node-waf clean || (exit 0); node-waf configure build`
npm ERR! message `sh "-c" "node-waf clean || (exit 0); node-waf configure build"` failed with 1
npm ERR! errno {}
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/david/Documents/node.buser.net/npm-debug.log
npm not ok
bsuh commented 12 years ago

I can't replicate this issue. OS?

boozedog commented 12 years ago

Ubuntu 12.04 (development branch)

I was surprised to see this: OSError: [Errno 2] No such file or directory: '/Users/brian/node_xslt/build'

Where is it getting the brian in the path?

bsuh commented 12 years ago

That is where I developed node_xslt, but I don't know how it's showing up in the build process. Could you post the contents of the wscript file?

boozedog commented 12 years ago
Davids-MacBook-Pro:package david$ cat wscript
import subprocess

srcdir = '.'
blddir = 'build'
VERSION = '0.1.3'

def set_options(opt):
    opt.tool_options('compiler_cxx')

def configure(conf):
    conf.check_tool('compiler_cxx')
    conf.check_tool('node_addon')
    conf.check(lib=['xml2', 'xslt'], uselib_store='M', mandatory=True)
    conf.env.set_variant('Release')

def build(bld):
    obj = bld.new_task_gen('cxx', 'shlib', 'node_addon')
    obj.target = 'node_xslt'
    obj.source = 'node_xslt.cc'
    obj.cxxflags = subprocess.Popen(["xml2-config", "--cflags"], stdout=subprocess.PIPE).communicate()[0].strip().split()
    obj.lib = ['xml2', 'xslt']
    obj.libpath = ['/usr/lib']

Davids-MacBook-Pro:package david$ pwd
/Users/david/.npm/node_xslt/0.1.5/package
bsuh commented 12 years ago

Can you try removing the "VERSION = '0.1.3'" line and rerunning "node-waf configure build"?

boozedog commented 12 years ago

Done ... didn't seem to help:


Davids-MacBook-Pro:package david$ node-waf configure build
Checking for program g++ or c++          : /usr/bin/g++ 
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for g++                         : ok  
Checking for node path                   : not found 
Checking for node prefix                 : ok /usr/local 
Checking for library ['xml2', 'xslt']    : yes 
'configure' finished successfully (0.184s)
Waf: Entering directory `/Users/brian/node_xslt/build'
Waf: Leaving directory `/Users/brian/node_xslt/build'
Traceback (most recent call last):
  File "/usr/local/bin/node-waf", line 16, in <module>
    Scripting.prepare(t, os.getcwd(), VERSION, wafdir)
  File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 145, in prepare
    prepare_impl(t, cwd, ver, wafdir)
  File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 135, in prepare_impl
    main()
  File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 188, in main
    fun(ctx)
  File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 386, in build
    return build_impl(bld)
  File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 405, in build_impl
    bld.compile()
  File "/usr/local/bin/../lib/node/wafadmin/Build.py", line 268, in compile
    os.chdir(self.bldnode.abspath())
OSError: [Errno 2] No such file or directory: '/Users/brian/node_xslt/build'
Davids-MacBook-Pro:package david$ pwd
/Users/david/.npm/node_xslt/0.1.5/package
bsuh commented 12 years ago

It looks like somehow that directory got cached by node-waf. Try "node-waf distclean configure build"

boozedog commented 12 years ago

Worked! So did I do something wrong? How can I avoid this issue next time?

bsuh commented 12 years ago

No. I think I was supposed to clean out the build directory before publishing to npm, but I didn't so it had node-waf's cache from my system there.

Anyways I added "node-waf distclean" to run before install, so that should prevent it from happening in the future again.

boozedog commented 12 years ago

Sweet. Thanks as always for your help!