Giter Site home page Giter Site logo

cf-sample-app-nodejs's People

Contributors

animatedmax avatar mpivotal avatar voelzmo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cf-sample-app-nodejs's Issues

Suggest adding a license file

Hi @mpivotal! Thanks for making this neat sample app. Would you be up for adding an open source license file to this repository, to help people feel welcome to deploy/reuse/adapt it? I know it's a simple app, but it's nice to have that clarity, especially in corporate and government environments. Thank you!

Repo is not maintained anymore ?

Hello Guys,

Is the repository is not maintained anymore? from account cockpit tutorial of Deploy a Sample App
(Guided Tour) links I found this repository to be downloaded as first step and the when I download this repository and deploy the same according to tutorial it does not work.

proxy issue?

anyone seen this? trying proxy in manifest or package.json does not help.

    Installing node modules (package.json)

npm ERR! Linux 4.4.0-109-generic
npm ERR! argv "/tmp/app/.cloudfoundry/0/node/bin/node" "/tmp/app/.cloudfoundry/0/bin/npm" "install" "--unsafe-perm" "--userconfig" "/tmp/app/.npmrc" "--cache" "/tmp/app/.npm"
npm ERR! node v4.8.4
npm ERR! npm v2.15.11
npm ERR! code ECONNRESET
npm ERR! network tunneling socket could not be established, cause=connect EINVAL 0.0.31.64:80 - Local (0.0.0.0:0)
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! Please include the following file with any support request:
npm ERR! /tmp/app/npm-debug.log
ERROR Unable to build dependencies: exit status 1

how to use the sample when using it with offline nodejs buildpack

Hello,

It is not an issue but listing my experience of using the sample app as test artifact whist setting up a pipeline to update offline buildpack behind a proxy. You may want to enhance your README with it.

  • In an offline buildpack scenario, you have to bundle your dependencies with the app and then run cf push. You will have to do the following for it
  1. Remove .cfignore or its content
  2. Run 'npm install' in the directory where you have cloned the code. You will see following warnings
npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.

and may want to update package.json with following

,
  "repository": {
    "type": "git",
    "url": "cf-nodejs"
  },
  "license": "ISC",
  1. Specify the version of node.js, npm in your package.json e.g.
,
  "engines": {
    "node": "0.12.7",
    "npm": "2.7.4"
  }

Failed to compile droplet: Failed to run all supply scripts

Trying out the nodejs sample nearly verbatim, but still seeing errors. When trying to build app. ๐Ÿ˜•

Manifest:

applications:
- name: strapi-cms
  buildpacks:
    - nodejs_buildpack
  memory: 1024M
  disk_quota: 4096M
  command: NODE_ENV=production npm run build

Procfile:
web: node server.js

Output:

Creating app strapi-cms...
Mapping routes...
Comparing local files to remote cache...
Packaging files to upload...
Uploading files...
 77.15 MiB / 77.15 MiB [=============================================================================================================================] 100.00% 1m51s

Waiting for API to complete processing files...

Staging app and tracing logs...
   Downloading nodejs_buildpack...
   Downloaded nodejs_buildpack
   Cell c51e9a40-dff6-400a-b1b0-c88318aae8f2 creating container for instance 583e0d2c-0a4f-4ac5-bf57-733277718c2a
   Cell c51e9a40-dff6-400a-b1b0-c88318aae8f2 successfully created container for instance 583e0d2c-0a4f-4ac5-bf57-733277718c2a
   Downloading app package...
   Downloaded app package (138.9M)
   -----> Nodejs Buildpack version 1.7.32
   -----> Installing binaries
          engines.node (package.json): >=10.16.0 <=14.x.x
          engines.npm (package.json): >=6.0.0
          **WARNING** Dangerous semver range (>) in engines.node. See: http://docs.cloudfoundry.org/buildpacks/node/node-tips.html
   -----> Installing node 12.19.0
          Download [https://buildpacks.cloudfoundry.org/dependencies/node/node_12.19.0_linux_x64_cflinuxfs3_03ab83e5.tgz]
          npm 6.14.8 already installed with node
   -----> Installing yarn 1.22.10
          Download [https://buildpacks.cloudfoundry.org/dependencies/yarn/yarn_1.22.10_linux_noarch_any-stack_0057c1c9.tgz]
          Installed yarn 1.22.10
   -----> Creating runtime environment
          NODE_ENV=production
          NODE_HOME=/tmp/contents722639036/deps/0/node
          NODE_MODULES_CACHE=true
          NODE_VERBOSE=false
          NPM_CONFIG_LOGLEVEL=error
          NPM_CONFIG_PRODUCTION=true
   -----> Building dependencies
          Installing node modules (yarn.lock)
          Running yarn in online mode
          To run yarn in offline mode, see: https://yarnpkg.com/blog/2016/11/24/offline-mirror
   yarn install v1.22.10
   [1/4] Resolving packages...
   [2/4] Fetching packages...
   warning [email protected]: Invalid bin field for "url-loader".
   info [email protected]: The platform "linux" is incompatible with this module.
   info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
   info [email protected]: The platform "linux" is incompatible with this module.
   info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
   [3/4] Linking dependencies...
   warning "strapi-admin > [email protected]" has unmet peer dependency "[email protected] - 3".
   warning "strapi-admin > [email protected]" has unmet peer dependency "popper.js@^1.16.1".
   warning "strapi-plugin-users-permissions > [email protected]" has unmet peer dependency "koa@>=2.0.0".
   warning " > [email protected]" has incorrect peer dependency "knex@^0.20.0".
   [4/4] Building fresh packages...
   error /tmp/app/node_modules/sharp: Command failed.
   Exit code: 1
   Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
   Arguments: 
   Directory: /tmp/app/node_modules/sharp
   Output:
   ERR! sharp 'darwin-x64' binaries cannot be used on the 'linux-x64' platform. Please remove the 'node_modules/sharp' directory and run 'npm install' on the 'linux-x64' platform.
   info sharp Attempting to build from source via node-gyp but this may fail due to the above error
   info sharp Please see https://sharp.pixelplumbing.com/install for required dependencies
   make: Entering directory '/tmp/app/node_modules/sharp/build'
     TOUCH Release/obj.target/libvips-cpp.stamp
     CC(target) Release/obj.target/nothing/node_modules/node-addon-api/nothing.o
     AR(target) Release/obj.target/node_modules/node-addon-api/nothing.a
     COPY Release/nothing.a
     CXX(target) Release/obj.target/sharp/src/common.o
     CXX(target) Release/obj.target/sharp/src/metadata.o
     CXX(target) Release/obj.target/sharp/src/stats.o
     CXX(target) Release/obj.target/sharp/src/operations.o
     CXX(target) Release/obj.target/sharp/src/pipeline.o
     CXX(target) Release/obj.target/sharp/src/utilities.o
     CXX(target) Release/obj.target/sharp/src/sharp.o
     SOLINK_MODULE(target) Release/obj.target/sharp.node
   /usr/bin/ld: cannot find -l:libvips-cpp.so.42
   /usr/bin/ld: cannot find -l:libvips.so.42
   collect2: error: ld returned 1 exit status
   sharp.target.mk:173: recipe for target 'Release/obj.target/sharp.node' failed
   make: Leaving directory '/tmp/app/node_modules/sharp/build'
   make: *** [Release/obj.target/sharp.node] Error 1
   gyp ERR! build error 
   gyp ERR! stack Error: `make` failed with exit code: 2
   gyp ERR! stack     at ChildProcess.onExit (/tmp/contents722639036/deps/0/node/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
   gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
   gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
   gyp ERR! System Linux 4.15.0-122-generic
   gyp ERR! command "/tmp/contents722639036/deps/0/node/bin/node" "/tmp/contents722639036/deps/0/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
   gyp ERR! cwd /tmp/app/node_modules/sharp
   gyp ERR! node -v v12.19.0
   gyp ERR! node-gyp -v v5.1.0
   gyp ERR! not ok
   info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
          **ERROR** Unable to build dependencies: exit status 1
   Failed to compile droplet: Failed to run all supply scripts: exit status 14
   Exit status 223
   Cell c51e9a40-dff6-400a-b1b0-c88318aae8f2 stopping instance 583e0d2c-0a4f-4ac5-bf57-733277718c2a
   Cell c51e9a40-dff6-400a-b1b0-c88318aae8f2 destroying container for instance 583e0d2c-0a4f-4ac5-bf57-733277718c2a
Error staging application: App staging failed in the buildpack compile phase
FAILED
jerome@Ludwig strapi-cms % cf set-env strapi-cms  OPTIMIZE_MEMORY true
Setting env variable 'OPTIMIZE_MEMORY' for app strapi-cms in org sandbox-onrr / space jerome.louis as [email protected]...
OK
TIP: Use 'cf restage strapi-cms' to ensure your env variable changes take effect
jerome@Ludwig strapi-cms % cf restage strapi-cms
This action will cause app downtime.

Restaging app strapi-cms in org sandbox-onrr / space jerome.louis as [email protected]...

Staging app and tracing logs...
   Downloading nodejs_buildpack...
   Downloaded nodejs_buildpack
   Cell c51e9a40-dff6-400a-b1b0-c88318aae8f2 creating container for instance 18909f6f-c48b-485b-9a00-1d5e88713d13
   Cell c51e9a40-dff6-400a-b1b0-c88318aae8f2 successfully created container for instance 18909f6f-c48b-485b-9a00-1d5e88713d13
   Downloading app package...
   Downloaded app package (138.9M)
   -----> Nodejs Buildpack version 1.7.32
   -----> Installing binaries
          engines.node (package.json): >=10.16.0 <=14.x.x
          engines.npm (package.json): >=6.0.0
          **WARNING** Dangerous semver range (>) in engines.node. See: http://docs.cloudfoundry.org/buildpacks/node/node-tips.html
   -----> Installing node 12.19.0
          Download [https://buildpacks.cloudfoundry.org/dependencies/node/node_12.19.0_linux_x64_cflinuxfs3_03ab83e5.tgz]
          npm 6.14.8 already installed with node
   -----> Installing yarn 1.22.10
          Download [https://buildpacks.cloudfoundry.org/dependencies/yarn/yarn_1.22.10_linux_noarch_any-stack_0057c1c9.tgz]
          Installed yarn 1.22.10
   -----> Creating runtime environment
          NODE_ENV=production
          NODE_HOME=/tmp/contents051559757/deps/0/node
          NODE_MODULES_CACHE=true
          NODE_VERBOSE=false
          NPM_CONFIG_LOGLEVEL=error
          NPM_CONFIG_PRODUCTION=true
   -----> Building dependencies
          Installing node modules (yarn.lock)
          Running yarn in online mode
          To run yarn in offline mode, see: https://yarnpkg.com/blog/2016/11/24/offline-mirror
   yarn install v1.22.10
   [1/4] Resolving packages...
   [2/4] Fetching packages...
   warning [email protected]: Invalid bin field for "url-loader".
   info [email protected]: The platform "linux" is incompatible with this module.
   info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
   info [email protected]: The platform "linux" is incompatible with this module.
   info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
   [3/4] Linking dependencies...
   warning "strapi-admin > [email protected]" has unmet peer dependency "[email protected] - 3".
   warning "strapi-admin > [email protected]" has unmet peer dependency "popper.js@^1.16.1".
   warning "strapi-plugin-users-permissions > [email protected]" has unmet peer dependency "koa@>=2.0.0".
   warning " > [email protected]" has incorrect peer dependency "knex@^0.20.0".
   [4/4] Building fresh packages...
   error /tmp/app/node_modules/sharp: Command failed.
   Exit code: 1
   Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
   Arguments: 
   Directory: /tmp/app/node_modules/sharp
   Output:
   ERR! sharp 'darwin-x64' binaries cannot be used on the 'linux-x64' platform. Please remove the 'node_modules/sharp' directory and run 'npm install' on the 'linux-x64' platform.
   info sharp Attempting to build from source via node-gyp but this may fail due to the above error
   info sharp Please see https://sharp.pixelplumbing.com/install for required dependencies
   make: Entering directory '/tmp/app/node_modules/sharp/build'
     TOUCH Release/obj.target/libvips-cpp.stamp
     CC(target) Release/obj.target/nothing/node_modules/node-addon-api/nothing.o
     AR(target) Release/obj.target/node_modules/node-addon-api/nothing.a
     COPY Release/nothing.a
     CXX(target) Release/obj.target/sharp/src/common.o
     CXX(target) Release/obj.target/sharp/src/metadata.o
     CXX(target) Release/obj.target/sharp/src/stats.o
     CXX(target) Release/obj.target/sharp/src/operations.o
     CXX(target) Release/obj.target/sharp/src/pipeline.o
     CXX(target) Release/obj.target/sharp/src/utilities.o
     CXX(target) Release/obj.target/sharp/src/sharp.o
     SOLINK_MODULE(target) Release/obj.target/sharp.node
   /usr/bin/ld: cannot find -l:libvips-cpp.so.42
   /usr/bin/ld: cannot find -l:libvips.so.42
   collect2: error: ld returned 1 exit status
   sharp.target.mk:173: recipe for target 'Release/obj.target/sharp.node' failed
   make: *** [Release/obj.target/sharp.node] Error 1
   make: Leaving directory '/tmp/app/node_modules/sharp/build'
   gyp ERR! build error 
   gyp ERR! stack Error: `make` failed with exit code: 2
   gyp ERR! stack     at ChildProcess.onExit (/tmp/contents051559757/deps/0/node/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
   gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
   gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
   gyp ERR! System Linux 4.15.0-122-generic
   gyp ERR! command "/tmp/contents051559757/deps/0/node/bin/node" "/tmp/contents051559757/deps/0/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
   gyp ERR! cwd /tmp/app/node_modules/sharp
   gyp ERR! node -v v12.19.0
   gyp ERR! node-gyp -v v5.1.0
   gyp ERR! not ok
   info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
          **ERROR** Unable to build dependencies: exit status 1
   Failed to compile droplet: Failed to run all supply scripts: exit status 14
   Exit status 223
   Cell c51e9a40-dff6-400a-b1b0-c88318aae8f2 stopping instance 18909f6f-c48b-485b-9a00-1d5e88713d13
   Cell c51e9a40-dff6-400a-b1b0-c88318aae8f2 destroying container for instance 18909f6f-c48b-485b-9a00-1d5e88713d13
Error staging application: App staging failed in the buildpack compile phase
FAILED

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.