Home > Net >  Cannot find module core-js while installing firebase-tools with npm
Cannot find module core-js while installing firebase-tools with npm

Time:08-03

I'm trying to install firebase with npm to have a global access to its commands, but every time I try to run npm install -g firebase-tools I get this:

> npm install -g firebase-tools
C:\Users\dabek\.cache\firebase\tools\firebase -> C:\Users\dabek\.cache\firebase\tools\node_modules\firebase-tools\lib\bin\firebase.js

> [email protected] postinstall C:\Users\#user name#\.cache\firebase\tools\node_modules\firebase-tools\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"

node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module 'C:\Users\#user name#\CACHE~1\firebase\tools\NODE_M~1\FIREBA~1\NODE_M~1\core-js\-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: [email protected] (node_modules\firebase-tools\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\firebase-tools\node_modules\core-js):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] postinstall: `node -e "try{require('./postinstall')}catch(e){}"`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

  [email protected]
added 14 packages from 7 contributors and updated 1 package in 19.174s

(user name hidden only here for privacy reasons of course)

I'm running the command in the shell from the Firebase CLI binary from https://firebase.google.com/docs/cli#windows-standalone-binary (yes, I'm using Windows).

Any ideas? :/

CodePudding user response:

  1. Try to install from the regular windows cmd as administrator.
  2. Try to downgrade your node version to 14.18.0.
  • Related