Error: Cannot find module 'semver'
See original GitHub issue[REQUIRED] Environment info
firebase-tools:
> firebase --version
pkg/prelude/bootstrap.js:1244
throw error;
^
Error: Cannot find module 'semver'
Require stack:
-...\firebase\tools\lib\node_modules\firebase-tools\lib\bin\firebase.js
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 (internal/modules/cjs/loader.js:980:15)
at Function.Module._resolveFilename (pkg/prelude/bootstrap.js:1346:46)
at Function.Module._load (internal/modules/cjs/loader.js:862:27)
at Module.require (internal/modules/cjs/loader.js:1042:19)
at Module.require (pkg/prelude/bootstrap.js:1225:31)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous> (...\firebase\tools\lib\node_modules\firebase-tools\lib\bin\firebase.js:3:16)
at Module._compile (internal/modules/cjs/loader.js:1156:30)
at Module._compile (pkg/prelude/bootstrap.js:1281:32)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'...\\firebase\\tools\\lib\\node_modules\\firebase-tools\\lib\\bin\\firebase.js'
],
pkg: true
}
Platform: Windows 10 19041.264
[REQUIRED] Test case
See above
[REQUIRED] Steps to reproduce
firebase --version firebase login firebase init firebase anything
[REQUIRED] Expected behavior
I believe it opens a new browser window for me to login with.
[REQUIRED] Actual behavior
It fails to do anything at all.
> firebase login --debug
pkg/prelude/bootstrap.js:1244
throw error;
^
Error: Cannot find module 'semver'
Require stack:
- ...\firebase\tools\lib\node_modules\firebase-tools\lib\bin\firebase.js
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 (internal/modules/cjs/loader.js:980:15)
at Function.Module._resolveFilename (pkg/prelude/bootstrap.js:1346:46)
at Function.Module._load (internal/modules/cjs/loader.js:862:27)
at Module.require (internal/modules/cjs/loader.js:1042:19)
at Module.require (pkg/prelude/bootstrap.js:1225:31)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous> (...\firebase\tools\lib\node_modules\firebase-tools\lib\bin\firebase.js:3:16)
at Module._compile (internal/modules/cjs/loader.js:1156:30)
at Module._compile (pkg/prelude/bootstrap.js:1281:32)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'...\\firebase\\tools\\lib\\node_modules\\firebase-tools\\lib\\bin\\firebase.js'
],
pkg: true
}
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:10 (1 by maintainers)
Top Results From Across the Web
Npm install cannot find module 'semver' - Stack Overflow
Solution:Delete the npm-cache/npm folder in the installation directory of nodejs. In windows, it is in C:/User/Username/Appdata/Roaming/npm(or npm_cache). and ...
Read more >Npm can't find module "semver" error in Ubuntu 19.04
It asked me to run command 'npm ci' from which I started getting this error. I tried reinstalling npm but it won't work....
Read more >Fix - Cannot find module 'semver' error in Node.js - Reactgo
The Cannot find module 'semver' error occurs if you're trying to run an npm install command in your project. To solve the error...
Read more >Fix for Cannot Find Module 'Semver' on Ubuntu 20.04 #125
Fix for Cannot Find Module 'Semver' on Ubuntu 20.04 I was unable to run npm run setup --silent and npm run dev until...
Read more >JavaScript : Npm install cannot find module 'semver' - YouTube
JavaScript : Npm install cannot find module ' semver ' [ Gift : Animated Search Engine : https://bit.ly/AnimSearch ] JavaScript : Npm install ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Fixed.
Delete the folder referenced (above) and re-run firebase (below)
It will take a while to rebuild the directory, but let it go and it will work.
I am having a similar issue whenever I run firebase commands. you say “delete the folder referenced (above)” but you mention a file. What folder needs to be deleted?