firebase-tools: Error running deploy command in 11.10.0 - "Error: Cannot find module 'is-npm'"

Environment info

firebase-tools:

➜ npx firebase-tools --version
Downloading Chromium r869685 - 112.4 Mb [====================] 100% 0.0s 
11.10.0
Cannot find module 'is-npm'
Require stack:
- /Users/stewart/.npm/_npx/45995/lib/node_modules/firebase-tools/node_modules/update-notifier/index.js
- /Users/stewart/.npm/_npx/45995/lib/node_modules/firebase-tools/lib/bin/firebase.js

Platform:

macOS (m1)

Test case

Using version 11.10 to do a hosting:channel:deploy does succeed in deploying, however it fails to exit successfully as a error is thrown Cannot find module 'is-npm'

Steps to reproduce

run npx firebase-tools hosting:channel:deploy pr414-blah --only special-deploy --expires 14d --project test-project --debug

Expected behavior

The deploy succeeds and exits successfully with no errors.

Actual behavior

❯ npx firebase-tools hosting:channel:deploy pr414-blah --only special-deploy --expires 14d --project test-project  --debug
Downloading Chromium r869685 - 112.4 Mb [====================] 100% 0.0s 
[2022-09-23T08:52:38.718Z] > 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"]
[2022-09-23T08:52:38.719Z] > authorizing via signed-in user (***@***.com)
[2022-09-23T08:52:38.719Z] [iam] checking project test-project for permissions ["firebase.projects.get","firebasehosting.sites.update"]
[2022-09-23T08:52:38.721Z] > refreshing access token with scopes: []
...
✔  hosting:channel: Channel URL (***): https://***.web.app [expires 2022-10-07 10:52:45] 
[2022-09-23T08:53:10.615Z] Error: Cannot find module 'is-npm'
Require stack:
- /Users/stewart/.npm/_npx/46162/lib/node_modules/firebase-tools/node_modules/update-notifier/index.js
- /Users/stewart/.npm/_npx/46162/lib/node_modules/firebase-tools/lib/bin/firebase.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:101:18)
    at lazy (/Users/stewart/.npm/_npx/46162/lib/node_modules/firebase-tools/node_modules/import-lazy/index.js:2:51)
    at /Users/stewart/.npm/_npx/46162/lib/node_modules/firebase-tools/node_modules/import-lazy/index.js:10:11
    at UpdateNotifier.notify (/Users/stewart/.npm/_npx/46162/lib/node_modules/firebase-tools/node_modules/update-notifier/index.js:117:59)
    at process.<anonymous> (/Users/stewart/.npm/_npx/46162/lib/node_modules/firebase-tools/lib/bin/firebase.js:108:20)
    at process.emit (events.js:412:35)
    at process.exit (internal/process/per_thread.js:179:15)
    at /Users/stewart/.npm/_npx/46162/lib/node_modules/firebase-tools/lib/command.js:105:25
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

Error: An unexpected error has occurred.

Note that even --version triggers the error (see at the top of this issue)

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 39
  • Comments: 19 (3 by maintainers)

Commits related to this issue

Most upvoted comments

I suggest stopping with all the “me too”'s. It’s likely affecting a huge number of projects. Put a thumbs-up emoji on the top post.

If you’re using Firebase hosting and not getting this, a comment might make sense. It sounds like this currently affects everyone using this.

Confirmed @amithvns’s at-a-glance! Changed my github actions to use node 16 and it’s working.

image

For folks watching: we’re going to release this tomorrow morning

Our (@amithvns also ) app has some older dependencies that currently don’t work with node v16.x so we solved this by swapping the version before our build and then swapping back to 16x.

Here are our build steps

    steps:
      - uses: actions/checkout@v2
      - name: Setup node 14
        uses: actions/setup-node@v1
        with:
          node-version: 14.x
      - run: node -v && npm ci && npm run build
      - name: Setup node 16
        uses: actions/setup-node@v1
        with:
          node-version: 16.x

We are using Firebase hosting for different repo’s github actions and some are working and some are failing. At a quick glance looks like it is failing for actions where its set to use nodejs version 14.x and the actions are successful where we are not setting to use nodejs 14.x

I guess my real question is why did this really break? Because if you are specifying a version like FirebaseExtended/action-hosting-deploy@v0, shouldn’t it not have breaking changes unless we bump the version?

Same here

It’s happening to us also.

Same here

This is happening to us also.