nodejs / nodejs/node-gyp

error upgrading to node 14 and npm 7

Open
#2,577 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
10.7k
Forks
1.9k
Avg merge
1d 4h
Merged PRs (30d)
5

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported node-gyp configure path and the binding.gyp condition involving IS_DOWNLOADED; the log identifies node-gyp 7.1.2, gyp_main.py, and configure.js as entry points. Reproduce the Node 14/npm 7 installation failure and determine the expected handling of this binding.gyp evaluation error, with the staging build completing as the success condition.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, python
Domain
build-system, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.