NPM CI Cross-Platform Reliability

Viewed 592

Our NodeJS application should run on Linux and Windows servers. We have the following dilemma:

  • If we run npm i as our CI Build then we sometimes get errors due to differences between the developers laptop's NPM and the build server.
  • However, if we run npm ci then the build will presumably be locked to the platform of the developers laptop (Windows) and not work on a linux build server.

Maybe our assumptions are incorrect:

  • Do we need to build 2 versions of our app: one for each platform?
  • Does npm ci lock us into the platform of the developer's machine through package-lock.json?

Examples of builds working on developers Windows laptops and on Windows servers but not on a Linux server are apps like strapi or packages like sharp which compile stuff for the platform (.dlls for windows, godknowswhat for linux).

0 Answers
Related