inversify / InversifyJS

A powerful and lightweight inversion of control container for JavaScript & Node.js apps powered by TypeScript.
http://inversify.io/
MIT License
11.29k stars 716 forks source link

Unsupported platform for @inversifyjs/common@1.3.0 os:win32 #1607

Open josendf-basetis opened 2 hours ago

josendf-basetis commented 2 hours ago

Is there an existing issue for this?

Current behavior

Inversify v6.1.0 fails to install on windows because "win32" "os" is not present in @inversifyjs/common@1.3.0 package.json file.

Steps to reproduce

Under Microsoft Windows, using Node.JS version 22.11.0 npm version 10.9.0:

npm install inversify

The command fails with the following output:

npm error code EBADPLATFORM
npm error notsup Unsupported platform for @inversifyjs/common@1.3.0: wanted {"os":"darwin,linux"} (current: {"os":"win32"})
npm error notsup Valid os:  darwin,linux
npm error notsup Actual os: win32

Expected behavior

The inversify package is installed.

Possible solution

Add the "win32" platform to all the related inversify packages package.json files, including:

@inversifyjs/common @inversifyjs/core

Package version

6.1.0

Node.js version

22.11.0

In which operating systems have you tested?

Stack trace

npm error code EBADPLATFORM
npm error notsup Unsupported platform for @inversifyjs/common@1.3.0: wanted {"os":"darwin,linux"} (current: {"os":"win32"})
npm error notsup Valid os:  darwin,linux
npm error notsup Actual os: win32

Other

No response

mdg215199 commented 2 hours ago

Having same issue, and we haven't updated this package for months, and CICD was working fine (or at least, it was working fine as of Oct 3, 2024... which was the last time we made any changes in the code that would have kicked off the CICD prior to today.

mdg215199 commented 2 hours ago

I lied above... as we are actually using using 6.0.1 (package.json has "inversify": "^6.0.1") which shouldn't be dependent on inversifyjs/common and/or core, but am getting the following error in jenkins CICD now:

error @inversifyjs/common@1.3.0: The platform "win32" is incompatible with this module.
error Found incompatible module.
josendf-basetis commented 2 hours ago

Checked the following versions in package.json, using node v22 and v20:

"inversify": "=6.0.1", << OK

"inversify": "=6.0.2", << OK

"inversify": "=6.0.3", << OK

"inversify": "=6.1.0", << FAILS
mdg215199 commented 1 hour ago

Weird. It was updated to 6.0.2, which passes and works, but it was reverted to 6.0.1 and got the same error in jenkins when CICD was hit (bickering about inversifyjs/common@1.3.0). In my case, I'm good at updating to 6.0.2, though I'll check to see if I have any npm cache within the CICD. This is an older project, and we don't regularly make changes in this repo that often.

PS - @josendf-basetis, thanks again for doing a sanity check and testing the above, too!

notaphplover commented 16 minutes ago

Hey @josendf-basetis, @mdg215199, I just saw the issue. I see, it makes sense, this is due to a wrong use of devEngines on my side when I published @inversifyjs/* packages, I will patch it in the next hour.

I'm sorry for the bug, we are moving to a monorepo approach and are on our way to do some internal refactors