-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[BUG] Dev dependency should not throw “unsupported platform” error when using --production flag on npm install #2921
Comments
Also repros if a devDependency cannot be found. This was a warning in npm v6, but it's an error in npm v7. package.json
npm v6
npm v7
|
Is there a NPM config setting that we can change that will make EBADPLATFORM log as a warning and not an error? We don't even have a dependency on fsevents, but other dependencies we use do depend on it and list it as an optional dependency. Why should this be an error, it's optional? All our apps are built on Jenkins on a linux build server, so now we can't build on Linux anymore. 20:06:20 [INFO] Running 'npm install' in /jenkins/workspace/myapp-23.0-nightly/my-apps |
Running This happens when It seems to be a regression since it works on older versions on Node/npm. See storybookjs/storybook#14433 for some info. |
Going hand-in-hand with the main description and title for this issue, using There have been some workarounds that I've seen for this behavior, but none that sit super well for me. I do see many issues logged about this problem, though this is the first that I could find on the npm repository itself. If anybody is interested in the workarounds after I've done more testing, let me know. |
I can reproduce a variant of this with a simple {
"name": "my-package",
"version": "1.0.0",
"private": true,
"devDependencies": {
"non-existing-package": "*"
}
}
It fails with:
This is a pain when working with unpublished / private packages. Why does NPM have to fetch anything about the |
Relates to npm/cli#2921 This issue arises after moving from npm 6.x to 7.x or later. As the build agents are still on 6.x, we have not yet seen this issue there. As part of the release build for Keyman Developer, we bundle up some files and do some work in a temp folder to prepare folders for release. Even though we are only working with `dependencies` (e.g. using `npm install --production`), packages under `devDependencies` are still wrongly being checked by NPM. As we have two modules present in `devDependencies` that are only available when in the repo path, we need to remove them before attempting to continue. Yuck! ref: npm/cli#3975 (comment) ref: npm/cli#2921
Relates to npm/cli#2921 This issue arises after moving from npm 6.x to 7.x or later. As the build agents are still on 6.x, we have not yet seen this issue there. As part of the release build for Keyman Developer, we bundle up some files and do some work in a temp folder to prepare folders for release. Even though we are only working with `dependencies` (e.g. using `npm install --production`), packages under `devDependencies` are still wrongly being checked by NPM. As we have two modules present in `devDependencies` that are only available when in the repo path, we need to remove them before attempting to continue. Yuck! ref: npm/cli#3975 (comment) ref: npm/cli#2921
Hmmm I see that it's still a problem, even though I add the --omit=dev it still tries to install the devDependency and throws a unsupported platform error |
Current Behavior:
If you have a module that is not supported on your platform set in the
devDependencies
object in your package file and you do a production install using the--production
flag, the installation fails with an “Unsupported platform” (EBADPLATFORM
) error. Since the module should not be installed/used during a production install, it should also not throw an error or otherwise affect the outcome of the installation.Expected Behavior:
A module that’s declared in
devDependencies
should not affect the outcome of a production install.Steps To Reproduce:
devDependencies
. e.g.,Note that the installation fails because module M is not supported on your system, even though you’re doing a production build and module M should not be installed or used.
Environment:
The text was updated successfully, but these errors were encountered: