-
Notifications
You must be signed in to change notification settings - Fork 213
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
NPM-Packages should also differ between 32-Bit and 64-Bit #169
Comments
Hey! Are you talking about native modules that npm depends on, or native modules that were installed using npm? By default npm is run with the same 32/64 bit version of node that you have set. Native modules that npm depends on are not considered, however, I think, we don't even |
This is especially a problem when you have globally installed native modules Von: Marcel Klehr [[email protected]] Hey! Are you talking about native modules that npm depends on, or native modules that were installed using npm? By default npm is run with the same 32/64 bit version of node that you have set. Native modules that npm depends on are not considered, however, I think, we don't even npm install new npm versions... (nodist just downloads and extracts the zipped npm package; see https://github.com/marcelklehr/nodist/blob/master/lib/npm.js#L238) � .................................................................................................................................. .................................................................................................................................. This E-Mail and any attachments may contain confidential information and is intended solely for the addressee. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. |
If you call npm install -g nativemodule while you're on 64-Bit arch, and then switch to 32-bit arch there probably will be problems trying to use compiled 64-bit modules with 32 bit |
ok, so we're talking about packages installed with npm. So, I actually see two problems here:
Update: Something that was obvious to me that I should have clarified: The same problem does not only occur with different target architectures but also with major changes in Node's native API. |
Another option would be a possible environment variable that says where to take/put global modules from/to? |
|
npm has the For 2) this could be integrated into the |
Yes, that obviously doesn't work. I'm sure that there's a way to handle this. I'll think about it (and go to bed for now, it's past midnight here), and will come back to you if you haven't found a solution for this already Otherwise, one would need to use npm rebuild or npm rebuild -g respectively manually after version change if there's no automated solution Edit: Wouldn't it be a possibility to just have a 32-Bit and a 64-Bit global module folder? This would actually be the best solution in my eyes, as well as another developer I have talked to. It would just be needed a difference between 32-Bit and 64-Bit Applications. As an example, cordova and ionic have to be installed globally. In one shell, you are using 32-Bit packages, and in another you switch over to 64-Bit and say rebuild. The modules now work for the 64-Bit variant of the shell, but no more for the 32-Bit version. Practical use-cases for this would be concurrent builds on build systems like Jenkins, where multiple projects with different settings can be built at the same time with the same dependencies. |
I agree that separating global modules into different folders is a solution. I'm not sure that differentiating between 32bit and 64bit only is a sufficient solution, though, as native modules also need recompiling when merely the node version changes. #Node.js told me that the node people make sure to only break compiled modules with major version changes, so I'd go for e.g. only that doesn't work for locally set version requirements, because when cd-ing in your terminal you cannot automatically change the PATH, as well... :/ I'll think about this some more. I'm a bit too tired, atm :) |
Another solution came to my mind recently: Fix the node version for globally installed modules. I.e. if you |
each npm version should have different directory/path for global npm packages . It is clean and efficient approach |
This is needed, for example, for native modules. So just like v and v-64, it should exist npmv and npmv-64.
Would that be possible?
The text was updated successfully, but these errors were encountered: