question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Depoying Functions fails with the message "Build failed: {"error": {"canonicalCode": "INVALID_ARGUMENT", "errorMessage": "npm_install..."

See original GitHub issue

Related issues

[REQUIRED] Version info

node: 10.16.2 / 8.11.1

firebase-functions: 3.3.0

firebase-tools: 7.8.1 / 7.9.0

firebase-admin: 8.7.0 /8.8.0

[REQUIRED] Test case

N/A

[REQUIRED] Steps to reproduce

N/A

[REQUIRED] Expected behavior

Trying to deploy one specific function from my project should not fail

[REQUIRED] Actual behavior

Deploying one specific function from my project fails. Tries to deploy different functions. Tried with "engines": { "node": "8" } and "engines": { "node": "10" } but it failed . again. Delete package-lock.json and reinstalled node_modules with the same result.

{"@type":"type.googleapis.com/google.cloud.audit.AuditLog","status":{"code":3,"message":"INVALID_ARGUMENT"},"authenticationInfo":{"principalEmail":"mich.tsap@gmail.com"},"requestMetadata":{"requestAttributes":{},"destinationAttributes":{}},"serviceName":"cloudfunctions.googleapis.com","methodName":"google.cloud.functions.v1.CloudFunctionsService.UpdateFunction","resourceName":"projects/actisense-dev/locations/europe-west1/functions/groupE-hiFiLoFiCalculationsHttps"}

Were you able to successfully deploy your functions?

When deploying i get the following error in my console.

Build failed: {"error": {"canonicalCode": "INVALID_ARGUMENT", "errorMessage": "`npm_install` had stderr output:\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/yargs-b279f6c4/LICENSE'\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/yargs-b279f6c4/index.js'\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/@google-cloud/firestore-8f58c2ea/README.md'\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/@sentry/types-bc7c5fb7/dist/stackframe.js'\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/algoliasearch-1012c148/index.js'\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/algoliasearch-1012c148/LICENSE.txt'\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/@sentry/types-bc7c5fb7/dist/stacktrace.js'\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/date-fns-1ff3f002/index.js'\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/algoliasearch-1012c148/lite.js'\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/algoliasearch-1012c148/reactnative.js'\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/@babel/runtime-a76c0d53/helpers/esm/AsyncGenerator.js'\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/@sentry/types-bc7c5fb7/dist/status.js'\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/algoliasearch-1012c148/README.md'\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/@babel/runtime-a76c0d53/helpers/esm/asyncGeneratorDelegate.js'\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/@sentry/types-bc7c5fb7/dist/thread.js'\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/@babel/runtime-a76c0d53/helpers/esm/asyncIterator.js'\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/@sentry/types-bc7c5fb7/dist/transport.js'\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/mongodb-291237d0/lib/async/async_iterator.js'\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/@babel/runtime-a76c0d53/helpers/esm/asyncToGenerator.js'\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/@sentry/types-bc7c5fb7/dist/user.js'\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/@types/node-f1c8db24/globals.d.ts'\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/@firebase/auth-1b85ce5b/dist/auth.esm.js.map'\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/@babel/runtime-a76c0d53/helpers/esm/awaitAsyncGenerator.js'\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/@sentry/types-bc7c5fb7/dist/wrappedfunction.js'\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/@babel/runtime-a76c0d53/helpers/esm/AwaitValue.js'\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/@sentry/types-bc7c5fb7/dist/breadcrumb.d.ts.map'\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/mongodb-291237d0/lib/operations/bulk_write.js'\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/firebase-admin-a1197e24/lib/auth/auth-api-request.js'\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/@babel/runtime-a76c0d53/helpers/esm/classCallCheck.js'\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/@sentry/types-bc7c5fb7/dist/breadcrumb.js.map'\nnpm WARN tar ENOENT: no such file or directory, open


Functions deploy had errors with the following functions:
	groupE-hiFiLoFiCalculationsHttps


To try redeploying those functions, run:
    firebase deploy --only functions:groupE-hiFiLoFiCalculationsHttps


To continue deploying other features (such as database), run:
    firebase deploy --except functions

Error: Functions did not deploy properly.```

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
antoarvacommented, Dec 18, 2019

Usually this error occurred when you try to deploy a function with a custom node module which is located in a private repository and firebase cannot have access to that.

1reaction
mbleighcommented, May 15, 2020

If anyone else runs into an issue like this, please contact support as this is not an issue with the firebase-functions SDK and we won’t be able to help much here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to solve npm install error “npm ERR! code 1”
If your Node.js version is very recent, try downgrading. The stable version 14.16.1 worked.
Read more >
Common errors | npm Docs
You are trying to install on a drive that either has no space, or has no permission to write. Free some disk space...
Read more >
Troubleshooting Node.js Deploys - Heroku Dev Center
Your Node.js deploy failed - now what? Start with these simple steps to troubleshoot a build issue. Check the buildpack.
Read more >
Use Azure Pipelines to build and publish a Node.js package
You can use an Azure DevOps pipeline to build, deploy, and test JavaScript apps. This quickstart walks through how to use a pipeline...
Read more >
Npm install command failing with message "could not find ...
When I run the npm install command, npm starts downloading the dependencies. But then, suddenly, it stops with the error: npm ERR! code...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found