Feature: Support for OS-specific "scripts" properties in package.json #2006
Comments
This will never be done in npm. Use a There is no other valid use case for install scripts, and eventually non-gyp install scripts will not be supported. Use |
Would love to have you talk to our engineering team about this @isaacs — i think we use non-gyp install scripts in production. Sure our engineers wouldn't mind migrating to a "better" way, but I'm trying to make sure the functionality we depend on does not get deprecated here |
I call Windows PowerShell scripts from my package.json file. {
"name": "my-silly-app",
"version": "1.2.3",
"scripts": {
"myTestScript": "@powershell -NoProfile -ExecutionPolicy unrestricted -Command ./test.ps1"
}
} Why? Because unix-people learn bash, windows-people learn powershell :) I think that an OS specific package would make sense - or at least a warning message. |
This would be great, our team develops on different OSes and even simple things are complicated. There's absolutely need for this. Take a simple example of I find it frustrating how Node community is aggressive towards Windows users. I've seen several issues closed in haste without any consideration at all with bold statements like the one by @isaacs . Node needs to stop marketing itself as cross-platform if all you support is mac/linux and make everyones else's life a living hell. Please reopen and let's have a civilized discussion. |
@isaacs Please consider opening this again. This is coming from a Linux user, but not everyone uses Linux. Occasionally, I have to support Windows users as well, and native addons complicate this picture tremendously. |
I concur, we have an issue right now with migrating polymer elements from The script is very simple: |
|
@pguth then how does it know it is optional? I think you know more than I do, but that's a very confusing statement given this message : SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) |
@simeyla I think the gist of @pguth's problem is that:
Their issues are independent of this bug, and are that of a missing workaround within Docker's VM. |
@isiahmeadows @oliverjanik |
It's hard to find a cross-OS way to run commands like install, start, test, etc., without using an intermediary Node script to do conditional platform-checking and spawning, etc. For example, many people have "install" reference a make file; it would be nice to offer a .bat file version for win32 support.
There was a discussion about this in November--not sure if anything happened with it... Isaac suggested the following:
The text was updated successfully, but these errors were encountered: