cf push
https://docs.cloudfoundry.org/buildpacks/node/node-tips.html
Introduction to Cloud Foundry app deployment and management concepts.
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.
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",
,
"engines": {
"node": "0.12.7",
"npm": "2.7.4"
}
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!
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.
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
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.