Specifying dependencies Stay organized with collections Save and categorize content based on your preferences.
You specify the dependencies for your Node.js app by declaringthem in thepackage.json file.
For example, if you want to specifyLodash as a dependency, yourpackage.json file might look as follows:
{"dependencies":{"lodash":"^4.0.1"}}You can use any Linux-compatible Node.js package with App Engine flexibleenvironment, including packages that require native (C) extensions.
During deployment, the Node.js runtimeautomatically installsalldependencies declared in yourpackage.json file. By default, thenpm install command is used, however Yarn and Pnpm package managers are alsosupported:
Yarn: If a
yarn.lockfile exists, theyarn install --productioncommand is used instead.Pnpm: Supported only by Node.js runtimesversion 18 and version 20 (preview). If a
pnpm-lock.yamlfileexists, thepnpm installcommand is used instead.
Note that you must ensure that theyarn.lock orpnpm-lock.yaml file isnot specified in theskip_files section of yourapp.yaml file.
Installing a web framework
You'll need to use a web framework to enable your app to serve web requests. Youcan use any Node.js web framework including the following:
To use a particular web framework, such asExpress.js, add the framework to yourpackage.json file:
For example, the resultingpackage.json file might look as follows:
{"dependencies":{"lodash":"^4.0.1","express":"^4.16.2"}}Installing the Cloud Client Libraries
TheCloud Client Libraries for Node.js is the idiomatic way for Node.js developers to integrate with Google Cloudservices, such asFirestore in Datastore mode (Datastore)andCloud Storage.
To install the Node.js client library for Cloud Storage:
Install the Cloud Client Libraries locally by using a package manager:
To use
npm, run:npm install @google-cloud/storage
To use
yarn, run:yarn add @google-cloud/storage
To use
pnpm, run:pnpm add @google-cloud/storage
Set up authentication. You can configure the Cloud Client Libraries for Node.jstohandle authentication automatically.
Use theNode.js client library for Cloud Storagereference to implement support for the Cloud Storage service in yourapp.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-19 UTC.