No package.json found
search cancel

No package.json found

book

Article ID: 431665

calendar_today

Updated On:

Products

VMware Tanzu Application Platform

Issue/Introduction

Starting a Node app resulted in error. 

The app was deployed using a zip file.

e.g.,

cf push exampleapp -f manifest.yml -p test.zip --no-start --no-route

 

The push was successful.  However, when the app was attempted to be started, there was a warning message that the package.json was not found.

Staging app and tracing logs...
   Downloading nodejs_buildpack...
   Downloaded nodejs_buildpack (376.7M)
   Cell xxx creating container for instance yyy
   Security group rules were updated
   Cell xxx successfully created container for instance yyy
   Downloading app package...
   Downloaded app package (55.2M)
   -----> Nodejs Buildpack version 1.8.30
   -----> Bootstrapping python
   -----> Installing python 3.11.10
   Copy [/tmp/buildpacks/aaa/dependencies/bbb/python_3.11.10_linux_x64_cflinuxfs4_3bbfe1c5.tgz]
   -----> Installing binaries
   engines.node (package.json): unspecified
   engines.npm (package.json): unspecified (use default)
   [31;1m**WARNING**[0m Node version not specified in package.json or .nvmrc. See: http://docs.cloudfoundry.org/buildpacks/node/node-tips.html
   -----> Installing node 18.20.4
   Copy [/tmp/buildpacks/aaa/dependencies/bbb/node_18.20.4_linux_x64_cflinuxfs4_0d65a7d1.tgz]
   [31;1m**WARNING**[0m node 18.x.x will no longer be available in new buildpacks released after 2025-04-30.
   See: https://github.com/nodejs/Release
   Using default npm version: 10.7.0
   -----> Installing yarn 1.22.19
   Copy [/tmp/buildpacks/aaa/dependencies/bbb/yarn_1.22.19_linux_noarch_any-stack_32d0e82e.tgz]
   Installed yarn 1.22.19
   -----> Creating runtime environment
   [31;1m**WARNING**[0m No package.json found
   [34;1mPRO TIP:[0m It is recommended to vendor the application's Node.js dependencies
   Visit http://docs.cloudfoundry.org/buildpacks/node/index.html#vendoring
   NODE_ENV=production
   NODE_HOME=/tmp/contents999/deps/0/node
   NODE_MODULES_CACHE=true
   NODE_VERBOSE=false
   NPM_CONFIG_LOGLEVEL=error
   NPM_CONFIG_PRODUCTION=true
   -----> Building dependencies
   Skipping (no package.json)
   [31;1m**WARNING**[0m No package.json found
   [31;1m**WARNING**[0m This app may not specify any way to start a node process
   See: https://docs.cloudfoundry.org/buildpacks/node/node-tips.html#start

Environment

VMware Tanzu Application Service

Cause

The package.json file is not seen in the root directory in the zip file.

Resolution

Ensure that the package.json file is valid and existing in the root directory in the zip file.  Double check the zip file, by viewing the list of files and directories.

In the following good example, the package.json is confirmed to be at the root directory:

$ unzip -l test.zip
Archive:  test.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
      159  2026-02-26 18:24   manifest.yml
      324  2026-02-26 18:47   package.json
      315  2026-02-26 18:24   server.js
---------                     -------
      798                     3 files