SAP-samples / hana-hdbext-promisfied-example

Example of how to use @sap/hdbext (standard node.js SAP HANA interface) via a promisfied wrapper.
Apache License 2.0
13 stars 8 forks source link

os dependency only to Darwin #14

Open naganaidu-rezi opened 1 year ago

naganaidu-rezi commented 1 year ago

we are building npm package on linux machine but this module has dependencies just with OS type as Darwin, can you also add OC type linux to it please ?

error:

npm ERR! code EBADPLATFORM npm ERR! notsup Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin"} (current: {"os":"linux"}) npm ERR! notsup Valid os: darwin npm ERR! notsup Actual os: linux npm ERR! A complete log of this run can be found in: /home/ec2-user/.npm/_logs/2023-04-11T06_36_05_000Z-debug-0.log [2023-04-11 06:36:05] ERROR the "before-all"" build failed: could not execute the "npm ci --include=dev" command: exit status 1 make: *** [pre_build] Error 1 Error: could not build the MTA project

jung-thomas commented 1 year ago

fsevents is not directly used by this package. It's not my module so of course I can't just add linux support to it. It's only coming in as an optional dependency within chokidar which in turn is only included due to Mocha. Mocha is used for unit testing and is a devDepenency in this project. It shouldn't be included in any production builds.

Are you able to install the package into your project in the linux environment and test the project there. I use this module in BAS with Linux all the time and I've never encountered this issue. Are you doing a production build? With MBT? A bit more details about the situation you are encountering would be helpful.

jung-thomas commented 1 year ago

One thing I've done just now that might help is I've deleted and recreated the npm-shrinkwrap for the module. Reading a lot of different threads about fsevents online, it seems to be a common issue in npm or yarn to include it fully in the dependencies incorrectly. See if the new shrinkwrap definition helps.

naganaidu-rezi commented 1 year ago

Sorry Jung for the delay, yes we are using mat build and we added to dev dependencies but still it is getting into the build. we have also added to the optional but didn't work

so hardcoded linux os support to package-lock.json and built it

is would be great if you able to add OS Linux

jung-thomas commented 1 year ago

I don't know what "mat build" is. You added what to dev dependencies?

is would be great if you able to add OS Linux

I don't have any control here. The module in question isn't mine. It dependency of a dependency. It's only part of mocha which is a testing module and only used at development. Hence mocha being in the dev dependency of my module. Delete your package-lock.json and rerun npm install in production mode. You shouldn't get this inner dependency at all.

naganaidu-rezi commented 1 year ago

sorry it was typo "mbt" tool

KarelVerbankCapgemini commented 1 year ago

Hi @naganaidu-rezi ,

We had the same issue with our build. However Thomas fixed the issue with the recreation of the npm-shrinkwrap module. We updated the sap-hdbext-promisfied dependency in our application to the latest version and the build works fine now. Thx for the fix.

Kr

naganaidu-rezi commented 1 year ago

Thank you Karel

danielantonio-mck commented 1 year ago

For some reason our package-lock.json does not update with this "optional" value so it keeps throwing errors, even though we are on latest version of this module. Any ideas? If I manually add it (optional: true) to the package-lock.json it works fine.

jung-thomas commented 10 months ago

I have completely removed Mocha from the Dev Dependencies. Unit tests will require that Mocha be installed globally in the development environment. But only project contributors will be running the unit tests. Therefore, consumption should be easier moving foward as we shouldn't have issues with the shrinkwrap incorrectly including the wrong dependencies for fsevents.