Closed alvis closed 9 months ago
Hi @alvis ,
Could you please specify which aws-lambda-ric
and npm
versions are you using?
On MacOS, with npm v9.5.1
and aws-lambda-ric v3.0.0
I am not able to face the issue you described:
npm install
> aws-lambda-ric@3.0.0 preinstall
> ./scripts/preinstall.sh
aws-lambda-cpp does not build on OS X. Skipping the preinstall step.
> aws-lambda-ric@3.0.0 postinstall
> ./scripts/postinstall.sh
aws-lambda-cpp does not build on OS X. Skipping the postinstall step.
Cleaning up source dependencies to save space
up to date, audited 462 packages in 895ms
65 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
Please note that it is not possible to fully install aws-lambda-ric
on MacOS since aws-lambda-cpp
does not build on OS X.
Hi @andclt I was trying to install aws-lambda-ric@3.0.0
with pnpm@8.7.0
. I tested to install it with npm and it's fine as mentioned. Probably there is discrepancy on how these two managers manage the life cycle scripts.
It's fine aws-lambda-ric can't be fully installed on MacOS coz the code will be deployed on a linux container.
We're using pnpm for managing our monorepo so changing to npm is unlikely.
Our current workaround is to install it with --ignore-scripts
to get aws-lambda-ric
installed for development on Mac.
Certainly not ideal.
Got it thanks.
Probably there is discrepancy on how these two managers manage the life cycle scripts.
Yes, the difference is that npm is looking for either an install or preinstall script whilepnpm
just checks for an install script.
I can confirm that with pnpm v8.9.2
this is fixed:
pnpm install aws-lambda-ric
Packages: +118
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 118, reused 118, downloaded 0, added 118, done
node_modules/.pnpm/aws-lambda-ric@3.0.0/node_modules/aws-lambda-ric: Running preinstall script, done in 155ms
node_modules/.pnpm/aws-lambda-ric@3.0.0/node_modules/aws-lambda-ric: Running postinstall script, done in 158ms
dependencies:
+ aws-lambda-ric 3.0.0
Done in 3.3s
This is an intriguing issue with the
install
script missing inpackage.json
in combination with binding.gyp on the root.According to npm documentation, and a equivalent implementation on pnpm
So on a Darwin machine, upon installation of
aws-lambda-ric
, the package manage will always run three life cycle scriptsNow, the problem is that required
deps/artifacts
needed to be extract beforenode-gyp rebuild
can be run but thepreinstall
script that is supposed to extract the dependencies is skipped on Darwin.So when installing on Darwin,
node-gyp rebuild
will fail with the following messageI guess the
node-gyp rebuild
step is intended to be skipped on Darwin, but it wouldn't with the current setup.If no rebuild is intended, the solution is to simply add an empty install script so the default behavior will not click in. e.g.