首页 > 解决方案 > 代码未部署在 Firebase 云上

问题描述

在 Firebase 云上部署我们的项目时,这是我的项目的一个错误。请告诉我这个问题的解决方案

C:\Users\Cloud Analogy\Desktop\Notifications\functions>firebase deploy

=== Deploying to 'rideservices-620cc'...

i  deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run lint
npm ERR! path C:\Users\Cloud Analogy\Desktop\Notifications\%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 'C:\Users\Cloud Analogy\Desktop\Notifications\%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\Cloud Analogy\AppData\Roaming\npm-cache\_logs\2018-08-27T19_50_57_450Z-debug.log

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

C:\Users\Cloud Analogy\Desktop\Notifications\functions>"predeploy": [
'"predeploy":' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Cloud Analogy\Desktop\Notifications\functions>"npm --prefix %RESOURCE_DIR% run lint"
'"npm --prefix %RESOURCE_DIR% run lint"' is not recognized as an internal or external command,
operable program or batch file.

标签: android

解决方案


打开Firebase.json并将 predeloy 更改为:

{
  ...  // your config
  "functions": {
    "predeploy": [
      "npm --prefix \"%RESOURCE_DIR%\" run lint"
    ],
    "source": "functions"
  }
  ... // your config
}

推荐阅读