cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Error deployment application nodejs in cloud foundry. Package.json not found

Former Member
0 Likes
5,034

Hi:

I'm new to Cloud Foundry and the deployment of Node.JS applications, that's why I need help on this subject: when I try to deploy an application, everything goes well to a point where it launches a series of bugs:

-----> Running go build supply
/tmp/buildpackdownloads/ddcdba8d520546385414ac76bc084798 ~
~
-----> Nodejs Buildpack version 1.6.43
-----> Installing binaries
       engines.node (package.json): unspecified
       engines.npm (package.json): unspecified (use default)
       **WARNING** Node version not specified in package.json or .nvmrc. See: http://docs.cloudfoundry.org/buildpacks/node/node-tips.html
-----> Installing node 6.16.0
       Copy [/tmp/cache/final/dependencies/1ddcdf685cd3fc7b305d07ba9666ccd5c4953849b3a9786b78e3bed3f26b3cf3/node-6.16.0-linux-x64-cflinuxfs3-45f43c54.tgz]
       Using default npm version: 3.10.10
-----> Installing yarn 1.13.0
       Copy [/tmp/cache/final/dependencies/b908d7fd5b7e3196dd2c6183012dc926e5a05820c60a77a0ae4f45155b1aaace/yarn-1.13.0-any-stack-125d40eb.tar.gz]
       Installed yarn 1.13.0
-----> Creating runtime environment
       **WARNING** No package.json found
       PRO TIP: 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/contents750942386/deps/0/node
       NODE_MODULES_CACHE=true
       NODE_VERBOSE=false
       NPM_CONFIG_LOGLEVEL=error
       NPM_CONFIG_PRODUCTION=true
-----> Building dependencies
       Skipping (no package.json)
-----> Running go build finalize
/tmp/buildpackdownloads/ddcdba8d520546385414ac76bc084798 ~
~
       **WARNING** No package.json found
       **WARNING** This app may not specify any way to start a node process
       See: https://docs.cloudfoundry.org/buildpacks/node/node-tips.html#start
Exit status 0
Uploading droplet, build artifacts cache...
Uploading droplet...
Uploading build artifacts cache...
Uploaded build artifacts cache (15.2M)
Uploaded droplet (15.4M)
Uploading complete
Cell 2503fd17-3462-4cd0-aef0-379ff9fefc87 stopping instance 1d0baca0-b624-406e-84db-dc5cc4c2a217
Cell 2503fd17-3462-4cd0-aef0-379ff9fefc87 destroying container for instance 1d0baca0-b624-406e-84db-dc5cc4c2a217
Cell 2503fd17-3462-4cd0-aef0-379ff9fefc87 successfully destroyed container for instance 1d0baca0-b624-406e-84db-dc5cc4c2a217
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 crashed
FAILED
Error restarting application: Start unsuccessful



I have the package.json and I have it in the same folder of the application, where it should be. For some reason you can't find it or you don't recognize it.
View Entire Topic
Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Pablo,

It would really help us more to understand whats going on with your project if you could post the content of some files as well - like manifest.yml and package.json.

It looks as though you didn't build your node application before pushing it to the cloud. Try issueing the following command:

npm install

This should create a folder named "node_modules". Check also that you have a start-up clause on your package.json. It should look like:

  "scripts": {
    "start": "node ./server.js"
  }

If you still face problems, share the files I've mentioned and we can go from there.

Best regards,
Ivan