I'm trying to switch an application to Firebase and transfer the backend to Firebase Cloud Functions.
This application is using a private package (@org/name
) as a dependency.
I've tried different solution, but none seems to work:
NPM_TOKEN
env: not possible since Firebase limits to lowercased configurationnpm install
the module in the functions directory.npmrc
file in the functions directory with both YARN and NPM auth tokenIt always rejects the deployment with:
Deploy Error: Build failed: Module @org/name not found in npm registry
Are private packages supported on Firebase ?
Google Cloud Functions now supports private NPM packages.
In order to use a private npm module, you have to provide credentials (auth token) for the npm registry in a .npmrc file located in the function's directory. You can simply copy the .npmrc file that was created in your home directory when you logged into npm using the npm login command.
Do not include the .npmrc file if you're not using private repositories, as it may increase the deployment time for your functions.
Source: https://cloud.google.com/functions/docs/writing/dependencies#using_private_modules
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With