igorklopov / enclose

Compile your Node.js project into an executable
http://enclosejs.com
Other
936 stars 43 forks source link

Contextify support #38

Closed mo4islona closed 9 years ago

mo4islona commented 9 years ago

Index.js

var Contextify = require('contextify');
var sandbox = { console : console, prop1 : 'prop1'};
Contextify(sandbox);
sandbox.run('console.log(prop1);');
sandbox.dispose();

Contextify use https://github.com/TooTallNate/node-bindings to load native module contextify.node

After compilation

Error: Could not locate the bindings file. Tried:
 → /Users/mo4islona/Projects/enclose/examples/contextify/build/contextify.node
 → /Users/mo4islona/Projects/enclose/examples/contextify/build/Debug/contextify.node
 → /Users/mo4islona/Projects/enclose/examples/contextify/build/Release/contextify.node
 → /Users/mo4islona/Projects/enclose/examples/contextify/out/Debug/contextify.node
 → /Users/mo4islona/Projects/enclose/examples/contextify/Debug/contextify.node
 → /Users/mo4islona/Projects/enclose/examples/contextify/out/Release/contextify.node
 → /Users/mo4islona/Projects/enclose/examples/contextify/Release/contextify.node
 → /Users/mo4islona/Projects/enclose/examples/contextify/build/default/contextify.node
 → /Users/mo4islona/Projects/enclose/examples/contextify/compiled/0.12.4/darwin/x64/contextify.node
    at bindings (<anonymous>)
    at Object.Math.Enclose.+/+t+h+e+b+o+x+/+U+s+e+r+s+/+m+o+4+i+s+l+o+n+a+/+P+r+o+j+e+c+t+s+/+e+n+c+l+o+s+e+/+e+x+a+m+p+l+e+s+/+c+o+n+t+e+x+t+i+f+y+/+n+o+d+e+_+m+o+d+u+l+e+s+/+c+o+n+t+e+x+t+i+f+y+/+l+i+b+/+c+o+n+t+e+x+t+i+f+y+.+j+s.dev (<anonymous>)
    at u (<anonymous>)
    at O (<anonymous>)
    at c (<anonymous>)
    at Object.Math.Enclose.+/+t+h+e+b+o+x+/+U+s+e+r+s+/+m+o+4+i+s+l+o+n+a+/+P+r+o+j+e+c+t+s+/+e+n+c+l+o+s+e+/+e+x+a+m+p+l+e+s+/+c+o+n+t+e+x+t+i+f+y+/+i+n+d+e+x+.+j+s.dev (<anonymous>)
    at u (<anonymous>)
    at <anonymous>
    at Math.Enclose (<anonymous>)
    at _third_party_main.js:1:76
igorklopov commented 9 years ago

Please try again with enclose 0.2.29

mo4islona commented 9 years ago

It works, thanks!

azcn2503 commented 9 years ago

Hello. I am receiving the same error using enclose 0.2.30 when requiring jsdoc (and contextify as one of its dependencies). On the build machine, I am able to use the resulting binary without any error, but when I deploy the binary to another machine it fails with the following error:

undefined:0

Error: Could not locate the bindings file. Tried:
  d:\thebox\Builds\131073\TOOL-PC-JOB1\node_modules\jsdom\node_modules\contextify\build\contextify.node
  d:\thebox\Builds\131073\TOOL-PC-JOB1\node_modules\jsdom\node_modules\contextify\build\Debug\contextify.node
  d:\thebox\Builds\131073\TOOL-PC-JOB1\node_modules\jsdom\node_modules\contextify\build\Release\contextify.node
  d:\thebox\Builds\131073\TOOL-PC-JOB1\node_modules\jsdom\node_modules\contextify\out\Debug\contextify.node
  d:\thebox\Builds\131073\TOOL-PC-JOB1\node_modules\jsdom\node_modules\contextify\Debug\contextify.node
  d:\thebox\Builds\131073\TOOL-PC-JOB1\node_modules\jsdom\node_modules\contextify\out\Release\contextify.node
  d:\thebox\Builds\131073\TOOL-PC-JOB1\node_modules\jsdom\node_modules\contextify\Release\contextify.node
  d:\thebox\Builds\131073\TOOL-PC-JOB1\node_modules\jsdom\node_modules\contextify\build\default\contextify.node
  d:\thebox\Builds\131073\TOOL-PC-JOB1\node_modules\jsdom\node_modules\contextify\compiled\0.12.7\win32\ia32\contextify.node
    at bindings (<anonymous>)
    at Object.Math.Enclose.+d+:+\+t+h+e+b+o+x+\+B+u+i+l+d+s+\+1+3+1+0+7+3+\+T+O+O+L+-+P+C+-+J+O+B+1+\+n+o+d+e+_+m+o+d+u+l+e+s+\+j+s+d+o+m+\+n+o+d+e+_+m+o+d+u+l+e+s+\+c+o+n+t+e+x+t+i+f+y+\+l+i+b+\+c+o+n+t+e+x+t+i+f+y+.+j+s.dev (<anonymous>)
    at r (<anonymous>)
    at N (<anonymous>)
    at f (<anonymous>)
    at Object.Math.Enclose.+d+:+\+t+h+e+b+o+x+\+B+u+i+l+d+s+\+1+3+1+0+7+3+\+T+O+O+L+-+P+C+-+J+O+B+1+\+n+o+d+e+_+m+o+d+u+l+e+s+\+j+s+d+o+m+\+l+i+b+\+j+s+d+o+m+\+b+r+o+w+s+e+r+\+i+n+d+e+x+.+j+s.dev (<anonymous>)
    at r (<anonymous>)
    at N (<anonymous>)
    at f (<anonymous>)
    at Object.Math.Enclose.+d+:+\+t+h+e+b+o+x+\+B+u+i+l+d+s+\+1+3+1+0+7+3+\+T+O+O+L+-+P+C+-+J+O+B+1+\+n+o+d+e+_+m+o+d+u+l+e+s+\+j+s+d+o+m+\+l+i+b+\+j+s+d+o+m+.+j+s.dev (<anonymous>)

I have been sure to run an npm install before running enclose.