App is being deployed across hosting, functions, firestore, ... This worked a few days ago without issues.
[REQUIRED] Actual behavior
[2023-01-03T20:19:27.563Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[2023-01-03T20:19:27.564Z] > authorizing via signed-in user (flair2k@gmail.com)
[2023-01-03T20:19:27.564Z] [iam] checking project shared-lists-8fc29 for permissions ["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","datastore.indexes.create","datastore.indexes.delete","datastore.indexes.list","datastore.indexes.update","firebase.projects.get","firebasehosting.sites.update"]
[2023-01-03T20:19:27.565Z] > refreshing access token with scopes: []
[2023-01-03T20:19:27.565Z] >>> [apiv2][query] POST https://www.googleapis.com/oauth2/v3/token [none]
[2023-01-03T20:19:27.566Z] >>> [apiv2][body] POST https://www.googleapis.com/oauth2/v3/token [omitted]
[2023-01-03T20:19:28.189Z] <<< [apiv2][status] POST https://www.googleapis.com/oauth2/v3/token 200
[2023-01-03T20:19:28.189Z] <<< [apiv2][body] POST https://www.googleapis.com/oauth2/v3/token [omitted]
[2023-01-03T20:19:28.240Z] >>> [apiv2][query] POST https://cloudresourcemanager.googleapis.com/v1/projects/shared-lists-8fc29:testIamPermissions [none]
[2023-01-03T20:19:28.240Z] >>> [apiv2][(partial)header] POST https://cloudresourcemanager.googleapis.com/v1/projects/shared-lists-8fc29:testIamPermissions x-goog-quota-user=projects/shared-lists-8fc29
[2023-01-03T20:19:28.240Z] >>> [apiv2][body] POST https://cloudresourcemanager.googleapis.com/v1/projects/shared-lists-8fc29:testIamPermissions {"permissions":["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","datastore.indexes.create","datastore.indexes.delete","datastore.indexes.list","datastore.indexes.update","firebase.projects.get","firebasehosting.sites.update"]}
[2023-01-03T20:19:28.320Z] <<< [apiv2][status] GET https://firebase-public.firebaseio.com/cli.json 200
[2023-01-03T20:19:28.320Z] <<< [apiv2][body] GET https://firebase-public.firebaseio.com/cli.json {"cloudBuildErrorAfter":1594252800000,"cloudBuildWarnAfter":1590019200000,"defaultNode10After":1594252800000,"minVersion":"3.0.5","node8DeploysDisabledAfter":1613390400000,"node8RuntimeDisabledAfter":1615809600000,"node8WarnAfter":1600128000000}
[2023-01-03T20:19:28.538Z] <<< [apiv2][status] POST https://cloudresourcemanager.googleapis.com/v1/projects/shared-lists-8fc29:testIamPermissions 200
[2023-01-03T20:19:28.538Z] <<< [apiv2][body] POST https://cloudresourcemanager.googleapis.com/v1/projects/shared-lists-8fc29:testIamPermissions {"permissions":["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","datastore.indexes.create","datastore.indexes.delete","datastore.indexes.list","datastore.indexes.update","firebase.projects.get","firebasehosting.sites.update"]}
[2023-01-03T20:19:28.538Z] >>> [apiv2][query] POST https://iam.googleapis.com/v1/projects/shared-lists-8fc29/serviceAccounts/shared-lists-8fc29@appspot.gserviceaccount.com:testIamPermissions [none]
[2023-01-03T20:19:28.538Z] >>> [apiv2][body] POST https://iam.googleapis.com/v1/projects/shared-lists-8fc29/serviceAccounts/shared-lists-8fc29@appspot.gserviceaccount.com:testIamPermissions {"permissions":["iam.serviceAccounts.actAs"]}
[2023-01-03T20:19:28.811Z] <<< [apiv2][status] POST https://iam.googleapis.com/v1/projects/shared-lists-8fc29/serviceAccounts/shared-lists-8fc29@appspot.gserviceaccount.com:testIamPermissions 200
[2023-01-03T20:19:28.812Z] <<< [apiv2][body] POST https://iam.googleapis.com/v1/projects/shared-lists-8fc29/serviceAccounts/shared-lists-8fc29@appspot.gserviceaccount.com:testIamPermissions {"permissions":["iam.serviceAccounts.actAs"]}
[2023-01-03T20:19:28.813Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/shared-lists-8fc29 [none]
[2023-01-03T20:19:29.215Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/shared-lists-8fc29 200
[2023-01-03T20:19:29.215Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/shared-lists-8fc29 {"projectId":"shared-lists-8fc29","projectNumber":"551816293327","displayName":"shared-lists","name":"projects/shared-lists-8fc29","resources":{"hostingSite":"shared-lists-8fc29","storageBucket":"shared-lists-8fc29.appspot.com","locationId":"europe-west3"},"state":"ACTIVE","etag":"1_53fce6f1-ba48-477f-ac2c-f7a7b61d6aec"}
=== Deploying to 'shared-lists-8fc29'...
i deploying firestore, functions, hosting
Running command: npm --prefix "$PROJECT_DIR" install
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
> core-js-pure@3.27.1 postinstall /Users/xxx/Documents/coding/shared-lists/node_modules/core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module '/Users/xxx/Documents/coding/shared-lists/node_modules/core-js-pure/-e'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function._resolveFilename (pkg/prelude/bootstrap.js:1955:46)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Function.runMain (pkg/prelude/bootstrap.js:1983:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-linux-arm64-gnu@12.3.4 (node_modules/@next/swc-linux-arm64-gnu):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-linux-arm64-gnu@12.3.4: wanted {"os":"linux","arch":"arm64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-linux-arm64-musl@12.3.4 (node_modules/@next/swc-linux-arm64-musl):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-linux-arm64-musl@12.3.4: wanted {"os":"linux","arch":"arm64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-android-arm64@12.3.4 (node_modules/@next/swc-android-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-android-arm64@12.3.4: wanted {"os":"android","arch":"arm64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-linux-x64-gnu@12.3.4 (node_modules/@next/swc-linux-x64-gnu):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-linux-x64-gnu@12.3.4: wanted {"os":"linux","arch":"x64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-freebsd-x64@12.3.4 (node_modules/@next/swc-freebsd-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-freebsd-x64@12.3.4: wanted {"os":"freebsd","arch":"x64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-android-arm-eabi@12.3.4 (node_modules/@next/swc-android-arm-eabi):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-android-arm-eabi@12.3.4: wanted {"os":"android","arch":"arm"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-win32-x64-msvc@12.3.4 (node_modules/@next/swc-win32-x64-msvc):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-win32-x64-msvc@12.3.4: wanted {"os":"win32","arch":"x64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-linux-arm-gnueabihf@12.3.4 (node_modules/@next/swc-linux-arm-gnueabihf):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-linux-arm-gnueabihf@12.3.4: wanted {"os":"linux","arch":"arm"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-darwin-arm64@12.3.4 (node_modules/@next/swc-darwin-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-darwin-arm64@12.3.4: wanted {"os":"darwin","arch":"arm64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-linux-x64-musl@12.3.4 (node_modules/@next/swc-linux-x64-musl):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-linux-x64-musl@12.3.4: wanted {"os":"linux","arch":"x64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-win32-ia32-msvc@12.3.4 (node_modules/@next/swc-win32-ia32-msvc):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-win32-ia32-msvc@12.3.4: wanted {"os":"win32","arch":"ia32"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-win32-arm64-msvc@12.3.4 (node_modules/@next/swc-win32-arm64-msvc):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-win32-arm64-msvc@12.3.4: wanted {"os":"win32","arch":"arm64"} (current: {"os":"darwin","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! core-js-pure@3.27.1 postinstall: `node -e "try{require('./postinstall')}catch(e){}"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the core-js-pure@3.27.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/xxx/.npm/_logs/2023-01-03T20_19_41_957Z-debug.log
Error: functions predeploy error: Command terminated with non-zero exit code 1
resolution attempts
So far I believe the problem to be with related to node version, as I have never seen the warning in the first log line:
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
I restricted the allowed versions in package.json using
and an .npmrc file with engine-strict=true to enforce a npm version compatible with lockfileVersion@2
Then a firebase deploy results in
i deploying firestore, functions, hosting
Running command: npm --prefix "$PROJECT_DIR" install
npm ERR! code ENOTSUP
npm ERR! notsup Unsupported engine for shared-lists@0.1.0: wanted: {"npm":">=7.24","node":">=16.13"} (current: {"node":"16.16.0","npm":"6.14.17"})
npm ERR! notsup Not compatible with your version of node/npm: shared-lists@0.1.0
npm ERR! notsup Not compatible with your version of node/npm: shared-lists@0.1.0
npm ERR! notsup Required: {"npm":">=7.24","node":">=16.13"}
npm ERR! notsup Actual: {"npm":"6.14.17","node":"16.16.0"}
This suggests, that in fact an incompatible version of npm (<7) is used. However running npm version tells me I am using npm: '8.19.2' and node: '18.12.1'
[REQUIRED] Environment info
firebase-tools: 11.19.0
Platform: macOS Ventura
node: 18.12.1 npm 8.19.2
[REQUIRED] Test case
package.json:
firebase.json:
[REQUIRED] Steps to reproduce
run
firebase deploy
[REQUIRED] Expected behavior
App is being deployed across hosting, functions, firestore, ... This worked a few days ago without issues.
[REQUIRED] Actual behavior
resolution attempts
So far I believe the problem to be with related to node version, as I have never seen the warning in the first log line:
I restricted the allowed versions in
package.json
usingand an
.npmrc
file withengine-strict=true
to enforce a npm version compatible with lockfileVersion@2Then a
firebase deploy
results inThis suggests, that in fact an incompatible version of npm (<7) is used. However running
npm version
tells me I am usingnpm: '8.19.2'
andnode: '18.12.1'