Firebase deployment errors starting with a non-zero exit code (space on the project path)

I recently had problems with the firebase deploy command. After the firebase deploy command, everything else was deployed except firebase (storage, database, etc.). So I decided to reinstall firebase to fix this situation, but after reinstalling, my problem got bigger. Now, none of them are deployed with the following error:

i deploying database, functions
Running command: npm --prefix $RESOURCE_DIR run lint
npm ERR! path C:\Users\faruk\Google Drive\Android\firebase\1\$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\faruk\Google Drive\Android\firebase\1\$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\faruk\AppData\Roaming\npm-cache\_logs\2018-01-24T18_21_34_878Z-debug.log

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

After a little research, I saw several topics about this, which tips to change

$RESOURCE_DIR to %RESOURCE_DIR%

on Windows systems (I use Windows 10 by the way). So, I edited my firebase.json file, which is at one top level of my function folder. like this. (I do not know if this is the correct file that I have to edit)

  "database": {
    "rules": "database.rules.json"
  },
  "functions": {
    "predeploy": [
      "npm --prefix %RESOURCE_DIR% run lint"
    ]
  }
}

, .

i  deploying database, functions
Running command: npm --prefix %RESOURCE_DIR% run lint

Usage: npm <command>

where <command> is one of:
    access, adduser, bin, bugs, c, cache, completion, config,
    ddp, dedupe, deprecate, dist-tag, docs, doctor, edit,
    explore, get, help, help-search, i, init, install,
    install-test, it, link, list, ln, login, logout, ls,
    outdated, owner, pack, ping, prefix, profile, prune,
    publish, rb, rebuild, repo, restart, root, run, run-script,
    s, se, search, set, shrinkwrap, star, stars, start, stop, t,
    team, test, token, tst, un, uninstall, unpublish, unstar,
    up, update, v, version, view, whoami

npm <command> -h     quick help on <command>
npm -l           display full usage info
npm help <term>  search for help on <term>
npm help npm     involved overview

Specify configs in the ini-formatted file:
    C:\Users\faruk\.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config

npm@5.6.0 C:\Program Files\nodejs\node_modules\npm

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

. .

+19
9

, - ( "Google " ):

C:\Users\faruk\Google Drive\Android\firebase\1\$RESOURCE_DIR\package.json

, npm, , .

, , . :

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

.

Firebase , , Windows.

+37

, Windows firebase.json :

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

:

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

, , .

+15

Windows. % RESOURCE_DIR%, Firebase, .

+1

, $ RESOURCE_DIR % RESOURCE_DIR% firebase.json

{
  "functions": {
    "predeploy": [
      "npm --prefix \"%RESOURCE_DIR%\" run lint",
      "npm --prefix \"%RESOURCE_DIR%\" run build"
    ]
  }
}
+1

( ), firebase script.

:

{
  "hosting": {
    "predeploy": "predeploy.sh",
    ...
}
Running command: predeploy.sh
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: spawn predeploy.sh ENOENT
    at exports._errnoException (util.js:1020:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
    at onErrorNT (internal/child_process.js:367:16)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)
    at Module.runMain (module.js:606:11)
    at run (bootstrap_node.js:389:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:504:3

Error: hosting predeploy error: Command terminated with non-zero exit code1

: ( ./)

{
  "hosting": {
    "predeploy": "./predeploy.sh",
    ...
}
0

VS Firecast ( firebase.json Resource Directory). firebase.json :

{
  "functions": {
    "predeploy": [
      "npm --prefix \"%RESOURCE_DIR%\" run lint",
      "npm --prefix \"%RESOURCE_DIR%\" run build"
    ]
  }
}
0

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

firebase.json,

0

, - :

function log(tag: string, value: any) {
    console.log(tag, JSON.stringify(value));
}

async , :)

0

functionsRun inside the project folder npm install. Perhaps you are importing one or more node modules that are not installed, in which case you need to runnpm install module_not_installed_yet --save

0
source

Source: https://habr.com/ru/post/1692661/


All Articles