0

When I want to deploy my site by making firebase deploy see this error

=== Deploying to 'project'...

i  deploying database, functions, hosting
Running command: npm --prefix "%RESOURCE_DIR%" run lint
npm ERR! path /Users/work/Desktop/project/project_2017/project-frontend/%RESOURCE_DIR%/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/Users/work/Desktop/project/project_2017/project-frontend/%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!     /Users/work/.npm/_logs/2018-07-11T21_15_01_202Z-debug.log

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

I may changed the parameter predeplay in firebase.json " npm --prefix \"$RESOURCE_DIR\" run lint" by "npm --prefix \"%RESOURCE_DIR %\" run lint"

DenisMasot
  • 697
  • 5
  • 11
  • 21

2 Answers2

1

Probably what happened was that some other person on your project changed the project firebase.json from this, which works on Linux and Mac:

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

to this, which works on Windows:

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

Using some advice found here on Stack Overflow. The reason for this change is because of differences in the way environment variables are used in shell commands.

There is not really a good way for the two of you to share this file, since you each have different needs. One of you is going to have to agree not to check in changes to this file, or you're both going to have to repeatedly undo each others' changes.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
0

it should be:

"predeploy": [
  "npm --prefix \"$RESOURCE_DIR\" run lint"
]
Egor Egorov
  • 705
  • 3
  • 10
  • 22