Got Error While doing npm

After doing npm i getting below error
uncaughtException: /lib64/libm.so.6: version GLIBC_2.29' not found (required by /prodexcelbot/node_modules/aspose.cells/lib/libAspose.Cells.so`)
image (6).png (50.1 KB)

@grenerobotics
Starting from v24.7.0, Aspose.Cells for Node.js via Java has been migrated to aspose.cells.java. Please check: the Note.
To fix the error, please try the following steps:

  1. Run: npm uninstall aspose.cells in /excel_test folder.
  2. remove aspose.cells folder in /excel_test/node_modules.
  3. Run: npm i aspose.cells.java to install Aspose.Cells for Node.js via Java.
  4. change require("aspose.cells") to require("aspose.cells.java") in your code.

Sorry for the inconvenience.

In addition, what version of Linux is used? What is the CPU architecture? Thank you.

while adding npm aspose.cells.java getting below error. even after removing node_modules folder and then doing npm i am getting this error.

npm ERR! code 1
npm ERR! path /excel_test/node_modules/java
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@10.2.0
npm ERR! gyp info using node@18.19.0 | linux | x64
npm ERR! gyp info find Python using Python version 3.6.8 found at “/usr/bin/python3”
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args ‘/excel_test/node_modules/node-gyp/gyp/gyp_main.py’,
npm ERR! gyp info spawn args ‘binding.gyp’,
npm ERR! gyp info spawn args ‘-f’,
npm ERR! gyp info spawn args ‘make’,
npm ERR! gyp info spawn args ‘-I’,
npm ERR! gyp info spawn args ‘/excel_test/node_modules/java/build/config.gypi’,
npm ERR! gyp info spawn args ‘-I’,
npm ERR! gyp info spawn args ‘/excel_test/node_modules/node-gyp/addon.gypi’,
npm ERR! gyp info spawn args ‘-I’,
npm ERR! gyp info spawn args ‘/root/.cache/node-gyp/18.19.0/include/node/common.gypi’,
npm ERR! gyp info spawn args ‘-Dlibrary=shared_library’,
npm ERR! gyp info spawn args ‘-Dvisibility=default’,
npm ERR! gyp info spawn args ‘-Dnode_root_dir=/root/.cache/node-gyp/18.19.0’,
npm ERR! gyp info spawn args ‘-Dnode_gyp_dir=/excel_test/node_modules/node-gyp’,
npm ERR! gyp info spawn args ‘-Dnode_lib_file=/root/.cache/node-gyp/18.19.0/<(target_arch)/node.lib’,
npm ERR! gyp info spawn args ‘-Dmodule_root_dir=/excel_test/node_modules/java’,
npm ERR! gyp info spawn args ‘-Dnode_engine=v8’,
npm ERR! gyp info spawn args ‘–depth=.’,
npm ERR! gyp info spawn args ‘–no-parallel’,
npm ERR! gyp info spawn args ‘–generator-output’,
npm ERR! gyp info spawn args ‘build’,
npm ERR! gyp info spawn args ‘-Goutput_dir=.’
npm ERR! gyp info spawn args ]
npm ERR! Traceback (most recent call last):
npm ERR! File “/excel_test/node_modules/node-gyp/gyp/gyp_main.py”, line 42, in
npm ERR! import gyp # noqa: E402
npm ERR! File “/excel_test/node_modules/node-gyp/gyp/pylib/gyp/init.py”, line 9, in
npm ERR! import gyp.input
npm ERR! File “/excel_test/node_modules/node-gyp/gyp/pylib/gyp/input.py”, line 8, in
npm ERR! import gyp.common
npm ERR! File “/excel_test/node_modules/node-gyp/gyp/pylib/gyp/common.py”, line 435
npm ERR! if CC := os.environ.get(“CC_target”) or os.environ.get(“CC”):
npm ERR! ^
npm ERR! SyntaxError: invalid syntax
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: gyp failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess. (/excel_test/node_modules/node-gyp/lib/configure.js:317:18)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:517:28)
npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:292:12)
npm ERR! gyp ERR! System Linux 4.18.0-513.18.1.el8_9.x86_64
npm ERR! gyp ERR! command “/usr/bin/node” “/excel_test/node_modules/.bin/node-gyp” “rebuild”
npm ERR! gyp ERR! cwd /excel_test/node_modules/java
npm ERR! gyp ERR! node -v v18.19.0
npm ERR! gyp ERR! node-gyp -v v10.2.0
npm ERR! gyp ERR! not ok

@grenerobotics
When installing aspose.cells.java, it uses node-gyp to compile the java bridge.
From the error message, Python 3.6.8 is too old for the latest version of node-gyp. I followed the steps below to install it successfully:

  1. Make sure gcc, g++ and make are installed. If not, use apt install gcc g++ make to install them.
  2. Make sure jdk is installed, JAVA_HOME is set, and java is added to the PATH environment variable.
  3. Delete the node_modules directory and execute npm install node-gyp@10.0.1
  4. Execute npm install aspose.cells.java
    Installation completed.

Another solution is to upgrade your python to the latest version. I can install aspose.cells.java successfully on other Linux with higher versions of python using just npm install aspose.cells.java.

Thank you.