I'm working on packaging a node app to be deployed on a server without npm. I believe I have it figured out - I used npm to install all the dependencies in a local node_modules folder according to a package.json file.
It all appears to work well, but when I attempt to run the node file from the server, it complains that it Cannot find module '../build/Release/contextify'
.
That makes sense, because in node_modules/.npm/contextify/0.0.4/package/lib/contextify.js
, it asks for the file in question, and node_modules/.npm/contextify/0.0.4/package/build
has no directory called Release
. I assumed that npm just hadn't built the release, so I switched back to the dev machine, and ran npm install
- it didn't complain, and it appeared to build contextify:
$ sudo npm install
> contextify@0.0.4 preinstall /path/to/node/stuff/node_modules/contextify
> node-waf clean || true; node-waf configure build
'clean' finished successfully (0.014s)
Setting srcdir to : /path/to/node/stuff/node_modules/.npm/contextify/0.0.4/package
Setting blddir to : /path/to/node/stuff/node_modules/.npm/contextify/0.0.4/package/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/Cellar/node/0.4.5
'configure' finished successfully (0.043s)
Waf: Entering directory `/path/to/node/stuff/node_modules/.npm/contextify/0.0.4/package/build'
[1/2] cxx: src/contextify.cc -> build/default/src/contextify_1.o
[2/2] cxx_link: build/default/src/contextify_1.o -> build/default/contextify.node
Waf: Leaving directory `/path/to/node/stuff/node_modules/.npm/contextify/0.0.4/package/build'
'build' finished successfully (0.370s)
unfortunately, the package/build
directory still doesn't have a Release
folder.
So, I guess the question is if contextify is failing to build because my node path isn't set (I tried export NODE_PATH
, but it didn't seem to help...), or if there is some other reason that contextify doesn't appear to be building.
Maybe I'm missing something larger?
I too am having the same issue,
You may want to add the issue to github, the author may be able to help you sooner than on here. https://github.com/brianmcd/contextify/issues?sort=created&direction=desc&state=closed&page=1