deep-foundation / deep-memo-app

The Unlicense
11 stars 8 forks source link

Unable to use firebase-admin npm package because of nodejs v`14.15.0` #45

Closed FreePhoenix888 closed 1 year ago

FreePhoenix888 commented 1 year ago

Unable to use firebase-sdk because nodejs 14.15.0 is not supported

freephoenix888@freephoenix888:~/Programming/dev/packages/sdk$ npm install --save firebase-admin
npm WARN old lockfile 
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile 
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile 
(################⠂⠂) ⠹ idealTree:inflate:node_modules/@capacitor/dialog: sill inflate node_modules/@capacitor/dialog
(################⠂⠂) ⠹ idealTree:inflate:node_modules/@capacitor/dialog: sill inflate node_modules/@capacitor/dialog
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'eslint-visitor-keys@3.3.0',
npm WARN EBADENGINE   required: { node: '^12.22.0 || ^14.17.0 || >=16.0.0' },
npm WARN EBADENGINE   current: { node: 'v14.15.0', npm: '8.19.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'espree@9.4.1',
npm WARN EBADENGINE   required: { node: '^12.22.0 || ^14.17.0 || >=16.0.0' },
npm WARN EBADENGINE   current: { node: 'v14.15.0', npm: '8.19.2' }
npm WARN EBADENGINE }

Which problems do we get because of this:

(node:29859) UnhandledPromiseRejectionWarning: Error: secretOrPrivateKey must be an asymmetric key when using RS256
    at Object.module.exports [as sign] (/home/freephoenix888/Programming/dev/test-push-notifications/node_modules/jsonwebtoken/sign.js:124:22)
    at ServiceAccountCredential.createAuthJwt_ (/home/freephoenix888/Programming/dev/test-push-notifications/node_modules/firebase-admin/lib/app/credential-internal.js:105:20)
    at ServiceAccountCredential.getAccessToken (/home/freephoenix888/Programming/dev/test-push-notifications/node_modules/firebase-admin/lib/app/credential-internal.js:77:28)
    at FirebaseAppInternals.refreshToken (/home/freephoenix888/Programming/dev/test-push-notifications/node_modules/firebase-admin/lib/app/firebase-app.js:45:49)
    at FirebaseAppInternals.getToken (/home/freephoenix888/Programming/dev/test-push-notifications/node_modules/firebase-admin/lib/app/firebase-app.js:37:25)
    at AuthorizedHttpClient.getToken (/home/freephoenix888/Programming/dev/test-push-notifications/node_modules/firebase-admin/lib/utils/api-request.js:617:34)
    at AuthorizedHttpClient.send (/home/freephoenix888/Programming/dev/test-push-notifications/node_modules/firebase-admin/lib/utils/api-request.js:605:21)
    at FirebaseMessagingRequestHandler.invokeRequestHandler (/home/freephoenix888/Programming/dev/test-push-notifications/node_modules/firebase-admin/lib/messaging/messaging-api-request-internal.js:64:32)
    at /home/freephoenix888/Programming/dev/test-push-notifications/node_modules/firebase-admin/lib/messaging/messaging.js:195:49
    at async main (/home/freephoenix888/Programming/dev/test-push-notifications/test.js:22:2)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:29859) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:29859) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

This problem does not happen if we use v14.21.2 nodejs

Konard commented 1 year ago

I think it is safe to try to use 14.21.2 in sdk repository alone.

FreePhoenix888 commented 1 year ago

@Konard allowed to use 14.21.2 in js-docker-isolation-provider