Skip to content
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

"Sorry, protobuf-ts was unable to install protoc..." when using older node version #16

Closed
Caffeinix opened this issue Oct 24, 2020 · 2 comments

Comments

@Caffeinix
Copy link

install.js uses the {recursive: true} option to fs.mkdirSync, which was only introduced in node 10.12.0. If you're using a version older than that, the option is silently ignored and you get:

Sorry, protobuf-ts was unable to install protoc...
ENOENT: no such file or directory, mkdir '/path/to/node_modules/@protobuf-ts/protoc/installed/protoc-3.13.0-linux-x86_64/include/google/protobuf'

It would probably be worthwhile to emit a more informative error message if you detect an old version of node.

@timostamm
Copy link
Owner

Thanks for the report, @Caffeinix.

protobuf-ts is tested against Node.js version 14.5.0. If you want to be sure that everything works as tested, you need to use this version or a later one.

But older versions are important as well, of course. Most things can be poly-filled. For example, the runtime requires globalThis, the rpc features require the fetch API.

Unfortunately, there is no documentation about what exactly is required for which node version. My plan is to look at it on a case-by-case basis and downgrade the code if applicable.

@protobuf-ts/protoc is a clear case for a downgrade. It should work in older node versions. I'll have a look into fixing this.

timostamm added a commit that referenced this issue Oct 26, 2020
Adds support for older node version that do not have the recursive option.

Should fix issue #16.
@timostamm
Copy link
Owner

@protobuf-ts/protoc should now work on node 10.12.0.

The update is released in v1.0.6.

The wrapper script now tries to install protoc when run the first time instead of just on installation. This should make it more robust in general.

@Caffeinix, if you notice any problems with older node versions, please me know. I will add support or at least a meaningful error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants