-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot find module './lib/reader/rTypes' during schema compilation #5
Comments
The Otherwise, I suspect that this is an environment problem. What is going on with |
I've looked at the |
I tried to compile it from /home/adam/, same error. I downloaded the plugin repo and made a necessary change in the c++ source of the compiler (increased arenaSpace from 20 to 21), because I had the same issue as this: https://groups.google.com/forum/#!topic/capnproto/aeSLSP7b-E0 So I tried to install the plugin from my locally changed source, hence the different install command. |
I have just noticed your next comment, that makes sense now, gonna try it now. |
So I finally managed to make it work, with a little workaround. So I did a trick: I started a "normal" install of the plugin from npm repo, and before the build of the c++ compiler failed (due to arenaSpace too low issue), I have copied the lib folder of the plugin (which already contained the extra files you mentioned). Then I pasted this lib folder to my local downloaded plugin repo (which contained the c++ compiler patch for arenaSpace), and install the plugin from my local repo globally. Then the code generation for my schema worked. If you know what could go wrong in the gulp build step, please let me know. It would be useful in case I bump into it again in the future. For now I have my compiler working so I can move on with my own prototype. Thanks a lot for looking into this! Cheers |
I blame this mess on my overzealousness. Magically installing the Capnproto compiler is a mistake. Docs should instruct users to install the compiler and refer them to the https://capnproto.org/install.html. A major version update in a week or two will fix this. |
I guess I can close this issue after two years has passed without new info about this. There is a new project filling the gap if anyone is trying to use capnproto in js/ts: https://github.com/jdiaz5513/capnp-ts |
After building the compiler, I try to compile a simple schema with the command:
$ capnp compile -ojs /home/adam/request.capnp
But it gives me this error:
module.js:338
throw err;
^
Error: Cannot find module './lib/reader/rTypes'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object. (/usr/local/lib/node_modules/capnp-js-plugin/index.js:1:80)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
js: plugin failed: exit code 1
It is clear to me that this rTypes module is required in the index.js of the plugin module itself, but I cannot find it anywhere.
It may be relevant that I have an NPM warning during building of the plugin:
npm WARN optional dep failed, continuing fsevents@0.3.6
I use Ubuntu 12.04 32-bit. Any help would be appreciated.
The text was updated successfully, but these errors were encountered: