No such file or directory\nyarn_install is likely not on the pat
Version info
firebase-functions: 2.0.5 firebase-tools: 5.1.1 firebase-admin: 5.13.1
Test case
Node version => 8. yarn version => 1.7.0 .
Trying to deploy a project with ~12 functions. I've deployed this project hundreds of times already.
Steps to reproduce
firebase deploy --only functions
Were you able to successfully deploy your functions?
Error message in terminal was: Deployment error. Build failed: {"message": "yarn_install yarn install --production\nexited with error [Errno 2] No such file or directory\nyarn_install is likely not on the path", "code": 1, "type": "INTERNAL_ERROR"}
Error message in functions console in firebase was:
{"@type":"type.googleapis.com/google.cloud.audit.AuditLog","status":{"code":3,"message":"Build failed: {"message": "yarn_install yarn install --production\nexited with error [Errno 2] No such file or directory\nyarn_install is likely not on the path", "code": 1, "type": "INTERNAL_ERROR"}"},"authenticationInfo":{"principalEmail":"XXX"},"serviceName":"cloudfunctions.googleapis.com","methodName":"google.cloud.functions.v1.CloudFunctionsService.UpdateFunction","resourceName":"XXX"}
Expected behavior
Functions to be deployed successfully.
Actual behavior
Getting the error logs from above, and failing to deploy.
It works when I use npm and not yarn for package management. Is this a known issue?
This started happening to me yesterday too across all of my projects
@ThePaulMcBride try to delete the yarn lock file and use npm's package lock as a workaround. I love yarn, but can't afford to be stuck by this issue.
Hi @itaydressler, there was a Google Cloud Functions outage during this time that affected deploys if there was a yarn.lock file included in the source code. The incident can be found here: https://status.firebase.google.com/incident/Functions/18038, with a workaround of deleting the yarn.lock file, as you correctly diagnosed. This issue has now been fixed.
Thanks @thechenky 🤟
Thanks everyone. Closing out.
I am now getting a similar, but slightly different error. Started happening in the last 24 hours. We had been doing several builds per day prior to this. Here's the error I get:
Build failed: {"message": "`yarn_install` had stderr output:\nerror @google-cloud/[email protected]: The engine \"node\" is incompatible with this module. Expected version \"~6\".\nerror Found incompatible module\n\nerror: `yarn_install` returned code: 1", "code": 1, "type": "USER_ERROR"}
This only happens intermittently. I can run a deploy with the same source code and installed dependencies against the same function multiple times and get different results.
[EDIT]
It seems that the issue I was having was related to having the @google-cloud/functions-emulator in my functions dev dependencies. This packages needs to be installed with the --ignore-engines (if using node > 6). Since this package isn't actually required for building or running my app, I simply removed it from package.json and will manage this dependency another way for my team.
Side note - it'd be great if we could have a way to only install production dependencies when firebase starts up, vs installing everything via yarn|npm install
Pleassssse let us only install prod dependencies