kessler / node-regedit

Read, Write, List and do all sorts of funky stuff to the windows registry using node.js and windows script host
MIT License
279 stars 45 forks source link

npm install on OS X ? #45

Closed kiuKisas closed 6 years ago

kiuKisas commented 6 years ago

Hi, I'm wrinting an multi-platform app and the windows version use node-regedit. I want to have the same source for both, windows and OS X, but when I try an npm install --verbose with node-regedit dependencies, I have this log:

npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for regedit@2.2.7: wanted {"os":"win32","arch":"any"} (current: {"os":"darwin","arch":"x64"})
npm ERR! notsup Valid OS:    win32
npm ERR! notsup Valid Arch:  any
npm ERR! notsup Actual OS:   darwin
npm ERR! notsup Actual Arch: x64
npm verb exit [ 1, true ]

Can I fix it and keep the same source code for both platform or should I create two differents projects ? Thank's in advance !

kessler commented 6 years ago

I'm not sure I want to allow installing this package on any system which is not windows, since it will simply not work.

However, I also understand the problem of wanting to have the same source code.

I'm willing to remove the restriction but in order to do that I need:

  1. A runtime check that will alert the user in case their program is running on a non compatible operating system
  2. Is there a warn mechanism on npm?

Care to submit a PR ?

kiuKisas commented 6 years ago

I find a way, I just set regedit as an optional dependencies and added some if statement to only load my code on windows. As you said, I'm not sure is a good idea to allow installing on any system, better this way. Tahnk's for your answer !