Error in `firebase init`: cannot find module `...libsodium.js`
[REQUIRED] Environment info
firebase-tools: 11.7.0
Platform: Windows
[REQUIRED] Test case
I tried to initialize firebase in my angular project but failed
[REQUIRED] Steps to reproduce
I tried to downgrade Angular version as well as uninstall and reinstall firebase-tools, npm but the result is still the same
[REQUIRED] Expected behavior
Someone please tell me what is the problem i am facing
[REQUIRED] Actual behavior
C:\Users\Janglee\Desktop\Artist>firebase init
node:internal/modules/cjs/loader:372
throw err;
^
Error: Cannot find module 'C:\Users\Janglee\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\libsodium\dist\modules\libsodium.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (node:internal/modules/cjs/loader:364:19)
at Function.Module._findPath (node:internal/modules/cjs/loader:577:18)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:942:27)
at Function.Module._load (node:internal/modules/cjs/loader:804:27)
at Module.require (node:internal/modules/cjs/loader:1028:19)
at require (node:internal/modules/cjs/helpers:102:18)
at C:\Users\Janglee\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\libsodium-wrappers\dist\modules\libsodium-wrappers.js:1:83553
at Object.<anonymous> (C:\Users\Janglee\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\libsodium-wrappers\dist\modules\libsodium-wrappers.js:1:83669)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
at Module.load (node:internal/modules/cjs/loader:1004:32)
at Function.Module._load (node:internal/modules/cjs/loader:839:12)
at Module.require (node:internal/modules/cjs/loader:1028:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Users\Janglee\AppData\Roaming\npm\node_modules\firebase-tools\lib\init\features\hosting\github.js:10:19)
at Module._compile (node:internal/modules/cjs/loader:1126:14) {
code: 'MODULE_NOT_FOUND',
path: 'C:\\Users\\Janglee\\AppData\\Roaming\\npm\\node_modules\\firebase-tools\\node_modules\\libsodium\\package.json',
requestPath: 'libsodium'
}
What version of Node are you running? npm?
Here are all the versions installed on my device.
Angular CLI: 14.1.3
Node: 16.17.0
Package Manager: npm 8.18.0
OS: win32 x64
Angular: 14.1.3
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1401.3
@angular-devkit/build-angular 14.1.3
@angular-devkit/core 13.0.4
@angular-devkit/schematics 13.0.4
@angular/fire 7.2.0
@schematics/angular 13.0.4
rxjs 7.4.0
typescript 4.7.4
I'll try to take a look on my windows machine at some point next week, but this reads as something that's likely odd in your specific setup, so I'm not sure how much I'll be able to do.
Hey @votatntai. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 3 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
Since there haven't been any recent updates here, I am going to close this issue.
@votatntai if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.