如何在Windows上使用Firebase-tools?

use*_*293 2 windows npm firebase firebase-tools

我想在Windows机器上开始使用firebase,但我不了解https://www.firebase.com/docs/web/quickstart.html上的入门说明.

我创建了一个包含以下内容的.html文件(从该页面上的说明复制).这样,信息被添加到数据库并从数据库中检索.但是我在Linux上丢失了像该页面上的$ npm install -g firebase-tools这样的指令.

我在https://www.firebase.com/docs/hosting/quickstart.html上的nodejs.org链接后面安装了nodejs

如果我在node.js屏幕上执行上面的命令(没有linux $ -prompt),我得到以下错误消息:npm应该在你的普通shell中运行在节点repl之外.(按Control-D退出.)

那么什么呢?

<html>
    <head>
        <script src="https://cdn.firebase.com/js/client/2.2.1/firebase.js"></script>
    </head>
    <body>
    <script>
        var myFirebaseRef = new Firebase("https://torrid-inferno-6000.firebaseio.com/");
        myFirebaseRef.set({
            title: "Hello!",
            author: "Firebase",
            location: {
                city: "San Francisco",
                state: "California",
                zip: 94103
            }
        });
        myFirebaseRef.child("location/city").on("value", function(snapshot) {
            alert(snapshot.val());  // Alerts "San Francisco"
        });
    </script>
    </body>
</html>
Run Code Online (Sandbox Code Playgroud)

use*_*293 10

基本上我必须打开命令提示符并切换到文件npm所在的C:\ Program Files \nodejs),然后根据指令执行npm命令.稍后安装firebase时,请执行重新启动以使PATH环境变量的更改生效.之后,firebase(init,deploy,...)命令可用于部署站点.