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.

Cannot deploy private packages with Node 10

See original GitHub issue

Version info node: 10.10.0 / 8.15.0 firebase-functions: 3.1.0 firebase-tools: 7.12.0

[REQUIRED] Test case N/A

[REQUIRED] Steps to reproduce Updating node 8.* to 10.* causes deployment errors. Firebase deploy seem to fail when:

i  functions: updating Node.js 10 (Beta) function api(us-central1)...
i  functions: updating Node.js 10 (Beta) function projector(us-central1)...

Unfortunately, an unauthorized error is given when accessing a private registry for dependencies. It seems that the .npmrc is ignored as it holds the _auth.

[REQUIRED] Expected behavior Trying to deploy should not fail. For now, I’m still using node 8.

[REQUIRED] Actual behavior

i  functions: updating Node.js 10 (Beta) function projector(us-central1)...
⚠  functions[projector(us-central1)]: Deployment error.
Build failed: {"error": {"canonicalCode": "INVALID_ARGUMENT", "errorMessage": "`npm_install` had stderr output:\nwarning ../package.json: No license field\nerror An unexpected error occurred: \"https://artifactory.persgroep.cloud/artifactory/api/npm/npm/vary/-/vary-1.1.2.tgz: Request failed \\\"401 Unauthorized\\\"\".\nnpm ERR! code ELIFECYCLE\nnpm ERR! errno 1\nnpm ERR! @ preinstall: `./install-function-dependencies`\nnpm ERR! Exit status 1\nnpm ERR! \nnpm ERR! Failed at the @ preinstall script.\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     /builder/home/.npm/_logs/2020-01-15T11_47_09_141Z-debug.log\n\nerror: `npm_install` returned code: 1", "errorType": "InternalError", "errorId": "67EE7395"}}
⚠  functions[api(us-central1)]: Deployment error.
Build failed: {"error": {"canonicalCode": "INVALID_ARGUMENT", "errorMessage": "`npm_install` had stderr output:\nwarning ../package.json: No license field\nerror An unexpected error occurred: \"https://artifactory.persgroep.cloud/artifactory/api/npm/npm/accepts/-/accepts-1.3.7.tgz: Request failed \\\"401 Unauthorized\\\"\".\nnpm ERR! code ELIFECYCLE\nnpm ERR! errno 1\nnpm ERR! @ preinstall: `./install-function-dependencies`\nnpm ERR! Exit status 1\nnpm ERR! \nnpm ERR! Failed at the @ preinstall script.\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     /builder/home/.npm/_logs/2020-01-15T11_47_09_583Z-debug.log\n\nerror: `npm_install` returned code: 1", "errorType": "InternalError", "errorId": "1600C76E"}}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:15
  • Comments:38 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
miketrebilcockcommented, Jan 17, 2020

We’ve got exactly the same issue, works fine on node 8, but node 10 deployment doesn’t seem to be using the .npmrc file

5reactions
blackholegalaxycommented, Jun 9, 2020

It seems the problem is still there as of today. I have a private package used by some of my functions. Functions are all using node 10. I placed a .npmrc in functions directory. It contains something like:

//npmregistry.somewebsite.io/:_authToken=THE_TOKEN_HERE

Installing, building locally works fine. But at deploy time:

Deployment error.
Build failed: error An unexpected error occurred:
"https://npmregistry.somewebsite.io/mypackage/-/mypackage-1.2.0.tgz: 
Request failed \"401 Unauthorized\"".; Error ID: cbdcecb0

Isn’t the .npmrc of functions directory supposed to be transmitted and used while deploying?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't deploy my Loopback package on private NPM repository ...
I want to deploy a Loopback package to a private NPM repository on Gitlab, but I am getting an "Unsupported engine" error :...
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 >
npm Registry - JFrog - JFrog Documentation
Overview. Artifactory provides full support for managing npm packages and ensures optimal and reliable access to npmjs.org.
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 >
Specifying dependencies in Node.js - Cloud Functions
js module you have installed. You can also use the require() function to import local files you deploy alongside your function. Using private...
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