IBM / cloudant-node-sdk

Cloudant SDK for Node.js
Apache License 2.0
28 stars 13 forks source link

error if upgrade npm to higher version #610

Closed scropion86 closed 2 years ago

scropion86 commented 2 years ago

Describe the bug

i am trying to install node-red , which by default work fine , but one of the dependencies i need require npm version higher than what is installed by default as per the log below

2021-12-15T13:09:37.294Z [err] notsup Required: {"node":">=12.18.3","npm":">=7.9.0"}
2021-12-15T13:09:37.294Z [err] npm ERR!
2021-12-15T13:09:37.294Z [err]  notsup Actual:   {"npm":"6.14.15","node":"14.17.6"}

then i changed the package.json to have the required version as below "npm": "7.x"

{
    "name": "node-red-app",
    "version": "1.1.3",
    "dependencies": {
        "@ibm-cloud/cloudant": "0.0.22",
        "bcrypt": "^5.0.1",
        "body-parser": "1.x",
        "express": "4.x",
        "http-shutdown": "1.2.2",
        "ibm-cloud-env": "^0",
        "node-red": "^2.1.4",
        "node-red-contrib-ibm-db2": "0.x",
        "node-red-node-cf-cloudant": "0.x",
        "node-red-node-openwhisk": "0.x",
        "node-red-node-watson": "0.x",
        "node-red-nodes-cf-sqldb-dashdb": "0.x"
    },
    "scripts": {
        "start": "node --max-old-space-size=160 index.js --settings ./bluemix-settings.js -v"
    },
    "engines": {
        "node": "14.x",
        "npm": "7.x"
    }
}

and committed the changes , and deployment failed with with below Log

Retrieving logs for app XXXXXXXXXX in org XXXXXXXXXX / space XXXXXX as XXXXXXXXXXXXXX...

   2021-12-15T13:34:03.19+0000 [API/13] OUT Created app with guid a677876c-7afb-4531-9b57-d25991520438
   2021-12-15T13:34:08.23+0000 [API/6] OUT Updated app with guid a677876c-7afb-4531-9b57-d25991520438 ({"route"=>"22c0e47e-defd-4833-9b4d-3101f073054f", :verb=>"add", :relation=>"routes", :related_guid=>"22c0e47e-defd-4833-9b4d-3101f073054f"})
   2021-12-15T13:34:10.82+0000 [API/23] OUT Uploading bits for app with guid a677876c-7afb-4531-9b57-d25991520438
   2021-12-15T13:34:35.82+0000 [API/24] OUT Creating build for app with guid a677876c-7afb-4531-9b57-d25991520438
   2021-12-15T13:34:36.53+0000 [API/24] OUT Updated app with guid a677876c-7afb-4531-9b57-d25991520438 ({"state"=>"STARTED"})
   2021-12-15T13:34:37.36+0000 [STG/0] OUT Downloading nodejs_buildpack...
   2021-12-15T13:34:37.45+0000 [STG/0] OUT Downloaded nodejs_buildpack
   2021-12-15T13:34:37.45+0000 [STG/0] OUT Cell abd60462-983f-4ada-90d4-cd3b63e1a665 creating container for instance c8bce89c-5cd8-4d74-8a0b-4999b2e1a928
   2021-12-15T13:34:41.25+0000 [STG/0] OUT Cell abd60462-983f-4ada-90d4-cd3b63e1a665 successfully created container for instance c8bce89c-5cd8-4d74-8a0b-4999b2e1a928
   2021-12-15T13:34:42.17+0000 [STG/0] OUT Downloading app package...
   2021-12-15T13:34:42.44+0000 [STG/0] OUT Downloaded app package (189K)
   2021-12-15T13:34:42.79+0000 [STG/0] OUT -----> Nodejs Buildpack version 1.7.61
   2021-12-15T13:34:42.81+0000 [STG/0] OUT -----> Installing binaries
   2021-12-15T13:34:42.81+0000 [STG/0] OUT        engines.node (package.json): 14.x
   2021-12-15T13:34:42.81+0000 [STG/0] OUT        engines.npm (package.json): 7.x
   2021-12-15T13:34:42.81+0000 [STG/0] OUT -----> Installing node 14.17.6
   2021-12-15T13:34:42.81+0000 [STG/0] OUT        Download [https://buildpacks.cloudfoundry.org/dependencies/node/node_14.17.6_linux_x64_cflinuxfs3_d7ed6f12.tgz]
   2021-12-15T13:34:59.78+0000 [STG/0] OUT        Downloading and installing npm 7.x (replacing version 6.14.15)...
   2021-12-15T13:37:28.59+0000 [STG/0] OUT -----> Installing yarn 1.22.10
   2021-12-15T13:37:28.59+0000 [STG/0] OUT        Download [https://buildpacks.cloudfoundry.org/dependencies/yarn/yarn_1.22.10_linux_noarch_any-stack_0057c1c9.tgz]
   2021-12-15T13:37:30.12+0000 [STG/0] OUT        Installed yarn 1.22.10
   2021-12-15T13:37:30.13+0000 [STG/0] OUT -----> Creating runtime environment
   2021-12-15T13:37:30.13+0000 [STG/0] OUT        PRO TIP: It is recommended to vendor the application's Node.js dependencies
   2021-12-15T13:37:30.13+0000 [STG/0] OUT        Visit http://docs.cloudfoundry.org/buildpacks/node/index.html#vendoring
   2021-12-15T13:37:30.13+0000 [STG/0] OUT        NODE_ENV=production
   2021-12-15T13:37:30.13+0000 [STG/0] OUT        NODE_HOME=/tmp/contents944812557/deps/0/node
   2021-12-15T13:37:30.13+0000 [STG/0] OUT        NODE_MODULES_CACHE=true
   2021-12-15T13:37:30.13+0000 [STG/0] OUT        NODE_VERBOSE=false
   2021-12-15T13:37:30.13+0000 [STG/0] OUT        NPM_CONFIG_LOGLEVEL=error
   2021-12-15T13:37:30.13+0000 [STG/0] OUT        NPM_CONFIG_PRODUCTION=true
   2021-12-15T13:37:30.13+0000 [STG/0] OUT -----> Building dependencies
   2021-12-15T13:37:30.14+0000 [STG/0] OUT        Installing node modules (package.json + package-lock.json)
   2021-12-15T13:42:13.21+0000 [STG/0] OUT npm notice 
   2021-12-15T13:42:13.21+0000 [STG/0] OUT npm notice New major version of npm available! 7.24.2 -> 8.3.0
   2021-12-15T13:42:13.22+0000 [STG/0] OUT npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.3.0>
   2021-12-15T13:42:13.22+0000 [STG/0] OUT npm notice Run `npm install -g npm@8.3.0` to update!
   2021-12-15T13:42:13.22+0000 [STG/0] OUT npm notice 
   2021-12-15T13:42:13.25+0000 [STG/0] OUT npm ERR! code 1
   2021-12-15T13:42:13.25+0000 [STG/0] OUT npm ERR! path /tmp/app/node_modules/ibm_db
   2021-12-15T13:42:13.26+0000 [STG/0] OUT npm ERR! command failed
   2021-12-15T13:42:13.26+0000 [STG/0] OUT npm ERR! command sh -c node-gyp rebuild
   2021-12-15T13:42:13.26+0000 [STG/0] OUT npm ERR! gyp info it worked if it ends with ok
   2021-12-15T13:42:13.26+0000 [STG/0] OUT npm ERR! gyp info using node-gyp@7.1.2
   2021-12-15T13:42:13.26+0000 [STG/0] OUT npm ERR! gyp info using node@14.17.6 | linux | x64
   2021-12-15T13:42:13.26+0000 [STG/0] OUT npm ERR! gyp info find Python using Python version 3.6.9 found at "/usr/bin/python3"
   2021-12-15T13:42:13.26+0000 [STG/0] OUT npm ERR! gyp http GET https://nodejs.org/download/release/v14.17.6/node-v14.17.6-headers.tar.gz
   2021-12-15T13:42:13.26+0000 [STG/0] OUT npm ERR! gyp http 200 https://nodejs.org/download/release/v14.17.6/node-v14.17.6-headers.tar.gz
   2021-12-15T13:42:13.26+0000 [STG/0] OUT npm ERR! gyp http GET https://nodejs.org/download/release/v14.17.6/SHASUMS256.txt
   2021-12-15T13:42:13.26+0000 [STG/0] OUT npm ERR! gyp http 200 https://nodejs.org/download/release/v14.17.6/SHASUMS256.txt
   2021-12-15T13:42:13.26+0000 [STG/0] OUT npm ERR! gyp info spawn /usr/bin/python3
   2021-12-15T13:42:13.26+0000 [STG/0] OUT npm ERR! gyp info spawn args [
   2021-12-15T13:42:13.26+0000 [STG/0] OUT npm ERR! gyp info spawn args   '/tmp/contents944812557/deps/0/node/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
   2021-12-15T13:42:13.26+0000 [STG/0] OUT npm ERR! gyp info spawn args   'binding.gyp',
   2021-12-15T13:42:13.26+0000 [STG/0] OUT npm ERR! gyp info spawn args   '-f',
   2021-12-15T13:42:13.26+0000 [STG/0] OUT npm ERR! gyp info spawn args   'make',
   2021-12-15T13:42:13.26+0000 [STG/0] OUT npm ERR! gyp info spawn args   '-I',
   2021-12-15T13:42:13.26+0000 [STG/0] OUT npm ERR! gyp info spawn args   '/tmp/app/node_modules/ibm_db/build/config.gypi',
   2021-12-15T13:42:13.26+0000 [STG/0] OUT npm ERR! gyp info spawn args   '-I',
   2021-12-15T13:42:13.28+0000 [STG/0] OUT npm ERR! gyp info spawn args   '/tmp/contents944812557/deps/0/node/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
   2021-12-15T13:42:13.28+0000 [STG/0] OUT npm ERR! gyp info spawn args   '-I',
   2021-12-15T13:42:13.28+0000 [STG/0] OUT npm ERR! gyp info spawn args   '/home/vcap/.cache/node-gyp/14.17.6/include/node/common.gypi',
   2021-12-15T13:42:13.28+0000 [STG/0] OUT npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
   2021-12-15T13:42:13.28+0000 [STG/0] OUT npm ERR! gyp info spawn args   '-Dvisibility=default',
   2021-12-15T13:42:13.28+0000 [STG/0] OUT npm ERR! gyp info spawn args   '-Dnode_root_dir=/home/vcap/.cache/node-gyp/14.17.6',
   2021-12-15T13:42:13.28+0000 [STG/0] OUT npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/tmp/contents944812557/deps/0/node/lib/node_modules/npm/node_modules/node-gyp',
   2021-12-15T13:42:13.28+0000 [STG/0] OUT npm ERR! gyp info spawn args   '-Dnode_lib_file=/home/vcap/.cache/node-gyp/14.17.6/<(target_arch)/node.lib',
   2021-12-15T13:42:13.28+0000 [STG/0] OUT npm ERR! gyp info spawn args   '-Dmodule_root_dir=/tmp/app/node_modules/ibm_db',
   2021-12-15T13:42:13.28+0000 [STG/0] OUT npm ERR! gyp info spawn args   '-Dnode_engine=v8',
   2021-12-15T13:42:13.28+0000 [STG/0] OUT npm ERR! gyp info spawn args   '--depth=.',
   2021-12-15T13:42:13.28+0000 [STG/0] OUT npm ERR! gyp info spawn args   '--no-parallel',
   2021-12-15T13:42:13.28+0000 [STG/0] OUT npm ERR! gyp info spawn args   '--generator-output',
   2021-12-15T13:42:13.28+0000 [STG/0] OUT npm ERR! gyp info spawn args   'build',
   2021-12-15T13:42:13.28+0000 [STG/0] OUT npm ERR! gyp info spawn args   '-Goutput_dir=.'
   2021-12-15T13:42:13.28+0000 [STG/0] OUT npm ERR! gyp info spawn args ]
   2021-12-15T13:42:13.28+0000 [STG/0] OUT npm ERR! gyp: name 'IS_DOWNLOADED' is not defined while evaluating condition 'IS_DOWNLOADED == "true" ' in binding.gyp while trying to load binding.gyp
   2021-12-15T13:42:13.28+0000 [STG/0] OUT npm ERR! gyp ERR! configure error 
   2021-12-15T13:42:13.28+0000 [STG/0] OUT npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
   2021-12-15T13:42:13.28+0000 [STG/0] OUT npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (/tmp/contents944812557/deps/0/node/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
   2021-12-15T13:42:13.28+0000 [STG/0] OUT npm ERR! gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
   2021-12-15T13:42:13.28+0000 [STG/0] OUT npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
   2021-12-15T13:42:13.28+0000 [STG/0] OUT npm ERR! gyp ERR! System Linux 5.4.0-87-generic
   2021-12-15T13:42:13.28+0000 [STG/0] OUT npm ERR! gyp ERR! command "/tmp/contents944812557/deps/0/node/bin/node" "/tmp/contents944812557/deps/0/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
   2021-12-15T13:42:13.28+0000 [STG/0] OUT npm ERR! gyp ERR! cwd /tmp/app/node_modules/ibm_db
   2021-12-15T13:42:13.28+0000 [STG/0] OUT npm ERR! gyp ERR! node -v v14.17.6
   2021-12-15T13:42:13.28+0000 [STG/0] OUT npm ERR! gyp ERR! node-gyp -v v7.1.2
   2021-12-15T13:42:13.28+0000 [STG/0] OUT npm ERR! gyp ERR! not ok
   2021-12-15T13:42:13.51+0000 [STG/0] OUT npm ERR! A complete log of this run can be found in:
   2021-12-15T13:42:13.51+0000 [STG/0] OUT npm ERR!     /tmp/cache/final/.npm/_logs/2021-12-15T13_42_13_290Z-debug.log
   2021-12-15T13:42:13.58+0000 [STG/0] OUT        **ERROR** Unable to build dependencies: exit status 1
   2021-12-15T13:42:14.49+0000 [STG/0] ERR Failed to compile droplet: Failed to run all supply scripts: exit status 14
   2021-12-15T13:42:14.52+0000 [STG/0] OUT Exit status 223
   2021-12-15T13:42:15.46+0000 [STG/0] OUT Cell abd60462-983f-4ada-90d4-cd3b63e1a665 stopping instance c8bce89c-5cd8-4d74-8a0b-4999b2e1a928
   2021-12-15T13:42:15.46+0000 [STG/0] OUT Cell abd60462-983f-4ada-90d4-cd3b63e1a665 destroying container for instance c8bce89c-5cd8-4d74-8a0b-4999b2e1a928
   2021-12-15T13:42:15.70+0000 [API/22] ERR Failed to stage build: staging failed
   2021-12-15T13:42:19.38+0000 [STG/0] OUT Cell abd60462-983f-4ada-90d4-cd3b63e1a665 successfully destroyed container for instance c8bce89c-5cd8-4d74-8a0b-4999b2e1a928
vmatyus commented 2 years ago

I cannot see any cloudant-node-sdk specific error in your logs. In package @ibm-cloud/cloudant only the engine version is specified, there is no restriction regarding the npm version. I see that your deployment is failing, but from the logs I cannot see any @ibm-cloud/cloudant specific entry.

By default the engine check is only warns the version mismatch. See engine-strict config, this way I suppose node-gyp might have some problem. Please contact with them.

scropion86 commented 2 years ago

thanks , i will take a look into node-gyp as well\