igorklopov / enclose

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

path wrong on cli use #5

Closed kredmer closed 9 years ago

kredmer commented 9 years ago

I tried: enclose server.js

then I have a new file server which I can execute:

./server

Result:

fs.js:502 return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode); ^ Error: ENOENT, no such file or directory '/thebox/then/my/path/and/another.js'

My path is prefixed with /thebox/ !

Thanks, Karsten

igorklopov commented 9 years ago

The path is spoiled intentionally. thebox is added to signal you that you require your submodule in some unusual way - probably using __dirname. And your submodule was not taken into the package at compile-time. How did you require your module? Please show that part of your code.

kredmer commented 9 years ago

global.base = dirname + '/' config = require(__base+'sqlconfig.js')

sqlconfig.js is the problem

igorklopov commented 9 years ago

EncloseJS parses your code and __base+'sqlconfig.js' is too difficult to understand what file to take in package. EncloseJS requires a simple string literal like require('./sqlconfig.js'). Also, there is another way - use config file and specify it in command line. Example: https://github.com/igorklopov/enclose/tree/master/examples/31-scripts

igorklopov commented 9 years ago

6 i am working on docs. Your problem will be described in troubleshooting

kredmer commented 9 years ago

I got this....but now I have problems with express.... dbp is not defined at at Layer.handle as handle_request at next () at Route.Math.Enclose.+/+t+h+e+b+o+x+/.../+n+o+d+e+_+m+o+d+u+l+e+s+/+e+x+p+r+e+s+s+/+l+i+b+/+r+o+u+t+e+r+/+r+o+u+t+e+.+j+s.Route.dispatch () at Layer.handle as handle_request at at Function.Math.Enclose.+/+t+h+e+b+o+x+/.../+n+o+d+e+_+m+o+d+u+l+e+s+/+e+x+p+r+e+s+s+/+l+i+b+/+r+o+u+t+e+r+/+i+n+d+e+x+.+j+s.proto.process_params () at next () at expressInit () at Layer.handle as handle_request

igorklopov commented 9 years ago

I made a simple project using express, compiled it and it works fine. Also, i did not find module dpb in express (that you mention). Could you find what means dpb, where it is, and how it is used. Maybe this is some kind of handler, that is called from express/lib/router/route.js

igorklopov commented 9 years ago

Hope you have solved your problems. Reopen otherwise.