-g firebase-tools 설치 시 protobufjs 오류
npm i -g firebase-tools
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead. npm WARN deprecated har-validator@5.1.5: this library is no longer supported npm ERR! command failed npm ERR! command sh -c node scripts/postinstall npm ERR! internal/modules/cjs/loader.js:638 npm ERR! throw err; npm ERR! ^ npm ERR! npm ERR! Error: Cannot find module '/root/.nvm/versions/node/v17.9.1/lib/node_modules/firebase-tools/node_modules/protobufjs/scripts/postinstall' npm ERR! at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) npm ERR! at Function.Module._load (internal/modules/cjs/loader.js:562:25) npm ERR! at Function.Module.runMain (internal/modules/cjs/loader.js:831:12) npm ERR! at startup (internal/bootstrap/node.js:283:19) npm ERR! at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3) npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2024-01-02T13_40_42_749Z-debug-0.log
해결방법
꼭 글로벌로 설치해야 하는게 아니라면, 글로벌 옵션을 빼고 설치해보자.
npm i firebase-tools
firbase-tools cli를 다음과 같이 실행할 수 있다.
npm exec -- firebase [CLI args]