Iam trying to install the jsonski package, but Iam encountering issues with node-gyp while doing so. I am able to run the node-gyp configure command without issues as seen below,
ubuntu@Ubuntu-22:~/JSON/JSONSki$ node-gyp configure
gyp info it worked if it ends with ok
gyp info using node-gyp@9.3.1
gyp info using node@14.21.3 | linux | x64
gyp info find Python using Python version 3.10.6 found at "/usr/bin/python3"
gyp info spawn /usr/bin/python3
gyp info spawn args [
gyp info spawn args '/home/ubuntu/.nvm/versions/node/v14.21.3/lib/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/home/ubuntu/JSON/JSONSki/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/ubuntu/.nvm/versions/node/v14.21.3/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/ubuntu/.cache/node-gyp/14.21.3/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/home/ubuntu/.cache/node-gyp/14.21.3',
gyp info spawn args '-Dnode_gyp_dir=/home/ubuntu/.nvm/versions/node/v14.21.3/lib/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/home/ubuntu/.cache/node-gyp/14.21.3/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/home/ubuntu/JSON/JSONSki',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp info ok
but the **node-gyp build **command fails. My binding.gyp file contains the following.
ubuntu@Ubuntu-22:~/JSON/JSONSki$ node-gyp build
gyp info it worked if it ends with ok
gyp info using node-gyp@9.3.1
gyp info using node@14.21.3 | linux | x64
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/home/ubuntu/JSON/JSONSki/build'
make: *** No rule to make target 'Release/obj.target/binding//home/ubuntu/JSON/JSONSki/src/JSONPathParser.o', needed by 'Release/obj.target/binding.node'. Stop.
make: Leaving directory '/home/ubuntu/JSON/JSONSki/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/ubuntu/.nvm/versions/node/v14.21.3/lib/node_modules/node-gyp/lib/build.js:203:23)
gyp ERR! stack at ChildProcess.emit (events.js:400:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:285:12)
gyp ERR! System Linux 5.19.0-35-generic
gyp ERR! command "/home/ubuntu/.nvm/versions/node/v14.21.3/bin/node" "/home/ubuntu/.nvm/versions/node/v14.21.3/bin/node-gyp" "build"
gyp ERR! cwd /home/ubuntu/JSON/JSONSki
gyp ERR! node -v v14.21.3
gyp ERR! node-gyp -v v9.3.1
gyp ERR! not ok
My binding.gyp file is as follows.
{
'targets': [
{
"target_name": "binding",
"sources": [ '/home/ubuntu/JSON/JSONSki/src/JSONPathParser.cpp',
'/home/ubuntu/JSON/JSONSki/src/JSONPathParser.h'
'/home/ubuntu/JSON/JSONSki/src/QueryAutomaton.h'
'/home/ubuntu/JSON/JSONSki/src/QueryProcessor.cpp'
'/home/ubuntu/JSON/JSONSki/src/QueryProcessor.h'
'/home/ubuntu/JSON/JSONSki/src/RecordLoader.cpp'
'/home/ubuntu/JSON/JSONSki/src/RecordLoader.h'
'/home/ubuntu/JSON/JSONSki/src/Records.h']
}
],
'include_dirs': ["<!(node -p \"require('node-addon-api').include_dir\")"],
'defines': [ 'NODE_ADDON_API_ENABLE_MAYBE' ],
}
Here is my package.json file content.
{
"name": "ubuntu",
"version": "1.0.0",
"description": "",
"main": "index.js",
"dependencies": {
"cmake-js": "^7.2.1",
"node-addon-api": "^6.0.0",
"node-gyp": "^9.3.1",
"nopt": "^7.0.0"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"install": "node-gyp rebuild"
},
"keywords": [],
"author": "",
"license": "ISC",
"gypfile": true
}
I have tried all the solutions provided in the below mentioned links, but none seem to fix the issue. I have also tried using nvm to install all versions of node form 14 to 19, still no luck. I have python 3.10.6 and gcc version 11.3.2 on my system.
- https://github.com/nodejs/node-gyp/issues/809
- GYP ERR! build error. stack Error: 'make' failed with exit code 2
- npm failed to install time with make not found error
- npm install mongoose causes gyp and kerberos errors (gssapi/gssapi.h file not found)
Any leads on how to get Jsonski running would be helpful.