简体   繁体   English

未全局安装时使用 firebase cli

[英]Using firebase cli when not installed globally

I'm using my work computer while developing a sort of side project.我在开发一种副项目时正在使用我的工作计算机。 Nothing crazy just learning some new firebase stuff.学习一些新的 firebase 东西没什么疯狂的。 Anyways, because it is a work computer I can't install modules globally.无论如何,因为它是一台工作计算机,所以我无法在全球范围内安装模块。 So when it came to installing firebase-cli I tried using the recommended global command:因此,在安装 firebase-cli 时,我尝试使用推荐的全局命令:

npm install -g firebase-tools

That didn't work because I don't have permission due to this being a work computer.那没有用,因为我没有权限,因为这是一台工作计算机。 So I created a firebase folder just for this project and ran所以我为这个项目创建了一个 firebase 文件夹并运行

npm install firebase-tools

In the new folder.在新文件夹中。 Once finished I tried running完成后我尝试运行

firebase -version

But this resulted in但这导致

firebase: command not found

I thought this would work since I'm in the directory I created and installed firebase in but it doesn't work.我认为这会起作用,因为我在我创建并安装 firebase 的目录中,但它不起作用。 Any help please!请帮忙!

If you want to run any command from a package that was installed in a project, use npm exec from the project folder.如果要从安装在项目中的 package 运行任何命令,请使用项目文件夹中的npm exec

npm exec -- firebase [CLI args]

The version command you were trying to run would go like this (note it's two dashes for the flag)您尝试运行的版本命令将像这样 go (请注意,标志是两个破折号)

npm exec -- firebase --version

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Firebase Firestore:全局检测何时有待处理的写入 - Firebase Firestore: globally detect when there are pending writes 无法使用 npm 安装 Firebase CLI - Can not install Firebase CLI using npm 尝试将我的 CLI 登录到 Firebase 时出现“出现问题” - Getting "Somthing went wrong" when trying to login my CLI into Firebase FirebaseCommandException:尝试运行命令时 Firebase CLI 发生错误 - FirebaseCommandException: An error occured on the Firebase CLI when attempting to run a command 我可以使用 yarn 作为 package 管理器安装 firebase CLI 吗? - Can I install firebase CLI using yarn as package manager? 如何使用 gcloud 控制台或 firebase 工具 CLI 为新的 firebase 项目启用 email 和密码登录提供程序? - How to enable email and password signin provider for new firebase project using gcloud console or firebase tools CLI? Firebase CLI 不工作(firebase 部署) - Firebase CLI not working (firebase deploy) 无法使用 Firebase CLI 登录 - Cannot login with the Firebase CLI 使用 Firebase CLI 添加项目成员 - Add project member with Firebase CLI Firebase 通过 Google 和 Apple 进行的身份验证仅在直接通过 APK 安装时有效? - Firebase Authentication via Google and Apple work only when installed directly through an APK?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM