question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Standalone CLI requires 'semver' module

See original GitHub issue

[REQUIRED] Environment info

firebase-tools:

pkg/prelude/bootstrap.js:1185
      throw error;
      ^

Error: Cannot find module 'semver'
1) If you want to compile the package/file into executable, please pay attention to compilation warnings and specify a literal in 'require' call. 2) If you don't want to compile the package/file into executable and want to 'require' it from filesystem (likely plugin), specify an absolute path in 'require' call using process.cwd() or process.execPath.
    at Function.Module._resolveFilename (module.js:546:15)
    at Function.Module._resolveFilename (pkg/prelude/bootstrap.js:1287:46)
    at Function.Module._load (module.js:473:25)
    at Module.require (module.js:595:17)
    at Module.require (pkg/prelude/bootstrap.js:1166:31)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/l145680/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/bin/firebase.js:3:14)
    at Module._compile (module.js:651:30)
    at Module._compile (pkg/prelude/bootstrap.js:1222:32)
    at Object.Module._extensions..js (module.js:662:10)

EDIT: Coworker (he has npm) ran the --version command and got 7.4.0

Platform: MacOS Mojave Version 10.14.6 (18G95)

[REQUIRED] Test case

  • Using the standalone binary OR Using the auto install script (curl -sL firebase.tools | bash)
  • Without npm
  • Causes the binary to error out

[REQUIRED] Steps to reproduce

Precondition:

  1. Do not have npm installed.

Steps: 1a. Download the standalone binary or 1b. Use the auto install script (curl -sL firebase.tools | bash)

  1. Attempt to run any firebase command (i.e. firebase --version)
  2. Receive Error: Cannot find module 'semver'

[REQUIRED] Expected behavior

Standalone binary can execute commands

[REQUIRED] Actual behavior

Standalone binary requires npm. Log for firebase --version --debug is the same as firebase --version.

pkg/prelude/bootstrap.js:1185
      throw error;
      ^

Error: Cannot find module 'semver'
1) If you want to compile the package/file into executable, please pay attention to compilation warnings and specify a literal in 'require' call. 2) If you don't want to compile the package/file into executable and want to 'require' it from filesystem (likely plugin), specify an absolute path in 'require' call using process.cwd() or process.execPath.
    at Function.Module._resolveFilename (module.js:546:15)
    at Function.Module._resolveFilename (pkg/prelude/bootstrap.js:1287:46)
    at Function.Module._load (module.js:473:25)
    at Module.require (module.js:595:17)
    at Module.require (pkg/prelude/bootstrap.js:1166:31)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/l145680/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/bin/firebase.js:3:14)
    at Module._compile (module.js:651:30)
    at Module._compile (pkg/prelude/bootstrap.js:1222:32)
    at Object.Module._extensions..js (module.js:662:10)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
samtsterncommented, Sep 30, 2019

Assigning this to standalone CLI czar @abeisgoat to take a look, thanks for filing!

0reactions
FrostyAnimations126commented, Nov 22, 2020

I get the exact same error, and I downloaded and ran the standalone binary yesterday

Read more comments on GitHub >

github_iconTop Results From Across the Web

Npm can't find module "semver" error in Ubuntu 19.04
I was basically trying to make offline use of FreeCodeCamp. It asked me to run command 'npm ci' from which I started getting...
Read more >
Npm install cannot find module 'semver' - Stack Overflow
I googled for a while and tried clearing npm cache npm cache verify , uninstalling my global angular cli ( npm uninstall -g...
Read more >
package.json - npm Docs
This document is all you need to know about what's required in your package.json file. It must be actual JSON, not just a...
Read more >
node-semver - PyPI
python version of [node-semver](https://github.com/isaacs/node-semver). install. pip install node-semver. examples. from semver import max_satisfying ...
Read more >
How to Install Specific Version of Node.js Package
NPM uses the Semantic Versioning Specification, which is the convention rule to stipulate the versioning of the packages. You see three numbers ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found