在npm --prefix $ RESOURCE_DIR上运行firebase部署firebase时出错 [英] Error deploying with firebase on npm --prefix $RESOURCE_DIR run lint

查看:66
本文介绍了在npm --prefix $ RESOURCE_DIR上运行firebase部署firebase时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我重新安装了Firebase工具(此教程之后),并且我正在尝试上传我的第一个Firebase函数.我在hello-world示例中遇到了这个问题,它们在您运行firebase init时会初始化(在init期间唯一设置功能CLI功能)

I have a fresh install of firebase tools (following this tutorial) and I'm trying to upload my first firebase function. I get this issue with the hello-world example that they initialise when you run firebase init (The only set up the functions CLI feature during the init)

如果我将firebase.json中的$RESOURCE_DIR替换为我的functions文件夹,它可以工作,但是,这当然是不好的做法,我想找到一个合适的$RESOURCE_DIR替代品来工作.

If I replace $RESOURCE_DIR in firebase.json with my functions folder it works, but of course that Is bad practice and I'd like to find a proper $RESOURCE_DIR replacement that works.

PS D:\workspace\firebase-functions> firebase deploy

    === Deploying to 'newagent-5221d'...

i  deploying functions
Running command: npm --prefix $RESOURCE_DIR run lint
npm ERR! path D:\workspace\firebase-functions\$RESOURCE_DIR\package.json
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open 'D:\workspace\firebase-functions\$RESOURCE_DIR\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\dtlut\AppData\Roaming\npm-cache\_logs\2018-01-19T15_57_22_990Z-debug.log

Error: functions predeploy error: Command terminated with non-zero exit code4294963238

推荐答案

尝试在您的firebase.json文件中将$ RESOURCE_DIR替换为%RESOURCE_DIR%.

Try to replace $RESOURCE_DIR with %RESOURCE_DIR% in your firebase.json file.

多平台解决方案

本文中看到的让我们总结一下配置针对您正在运行的不同平台:

As seen on this post let's summarize the configuration for the different platforms you are running on:

Linux

"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run lint"
]

PowerShell

PowerShell

"predeploy": [
"npm --prefix $Env:RESOURCE_DIR run lint"
]

Cmd.exe

"predeploy": [
"npm --prefix %RESOURCE_DIR% run lint"
]

这篇关于在npm --prefix $ RESOURCE_DIR上运行firebase部署firebase时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆