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

cafile is string 'undefined' on node 4.4 on windows #921

Closed
reconbot opened this issue May 8, 2016 · 8 comments
Closed

cafile is string 'undefined' on node 4.4 on windows #921

reconbot opened this issue May 8, 2016 · 8 comments

Comments

@reconbot
Copy link

reconbot commented May 8, 2016

The cafile option is the string undefined on windows and node 4.4 and maybe 4.3. I haven't figured out how to reduce this to a simple test case yet.

I noticed this on serialport and it was traced back to node-pre-gyp and the recent node-gyp update #837 that adds the option.

@reconbot
Copy link
Author

reconbot commented May 8, 2016

Specifically 32 bit windows (x86) https://ci.appveyor.com/project/j5js/node-serialport/build/1.0.380

@reconbot
Copy link
Author

reconbot commented May 8, 2016

The work around that seems to work involves setting cafile to a real file and then disabling strict-ssl. We still get warnings but the build doesn't fail.

@bnoordhuis
Copy link
Member

I don't think this is a node-gyp bug. Going by your description in mapbox/node-pre-gyp#209 (comment), it sounds like an issue with npm.

I could add a hack to ignore npm_config_cafile when it's the literal string 'undefined', but seeing how most people won't get that update until npm upgrades node-gyp, it might as well get fixed in npm itself.

@reconbot
Copy link
Author

reconbot commented May 8, 2016

I think you're right. As far as I can tell, npm sets the env vars during the install process? I've dug into node-gyp but not yet npm for this. I need to do more research to open the bug. Any help explaining it would help.

@bnoordhuis
Copy link
Member

Yes, npm exports the settings in .npmrc as npm_config_-prefixed environment variables to node-gyp (and other processes it spawns, I assume.)

It sounds like there is some interaction going on between cafile and strict-ssl that turns the former into 'undefined'.

@othiym23
Copy link
Contributor

othiym23 commented May 9, 2016

npm has no code that distinguishes between 32 and 64-bit Windows, so my guess is that this actually goes even further back to Node, or isn't caused by 32-bit vs 64-bit Windows builds.

@reconbot
Copy link
Author

reconbot commented May 9, 2016

I'm happy to do more testing. Heck this might be an issue with appveyor too. A good example of CI output showing what fails. https://ci.appveyor.com/project/j5js/node-serialport/build/1.0.370

I did another branch where I just dumped the env from node, and then the env from running npm install. The env is set by npm fine, node processes the env fine. node-pre-gyp has no code that touches the .env specifically.

https://ci.appveyor.com/project/j5js/node-serialport/build/1.0.400/job/lqxq20ahh0au81t1

@reconbot
Copy link
Author

reconbot commented May 9, 2016

I'm going to close this, I'm able to confirm we don't have these issues on this platform when node-pre-gyp isn't involved

@reconbot reconbot closed this as completed May 9, 2016
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

3 participants