BrainJS / brain.js

🤖 GPU accelerated Neural networks in JavaScript for Browsers and Node.js
https://brain.js.org
MIT License
14.35k stars 1.07k forks source link

brain.js not installing by npm #893

Closed rezwanahmedsami closed 1 year ago

rezwanahmedsami commented 1 year ago
╰─ npm install brain.js                                                      ─╯
npm WARN deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
npm ERR! code 1
npm ERR! path /Users/techcity/devwork/rightbiz-category-verifier-system/node_modules/gl
npm ERR! command failed
npm ERR! command sh -c prebuild-install || node-gyp rebuild
npm ERR! prebuild-install warn install No prebuilt binaries found (target=18.6.0 runtime=node arch=x64 libc= platform=darwin)
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.3.1
npm ERR! gyp info using node@18.6.0 | darwin | x64
npm ERR! gyp info find Python using Python version 3.9.6 found at "/Applications/Xcode.app/Contents/Developer/usr/bin/python3"
npm ERR! gyp info spawn /Applications/Xcode.app/Contents/Developer/usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/Users/techcity/devwork/rightbiz-category-verifier-system/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   '/Users/techcity/devwork/rightbiz-category-verifier-system/node_modules/gl/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/techcity/devwork/rightbiz-category-verifier-system/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/techcity/Library/Caches/node-gyp/18.6.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=/Users/techcity/Library/Caches/node-gyp/18.6.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/Users/techcity/devwork/rightbiz-category-verifier-system/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/techcity/Library/Caches/node-gyp/18.6.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Users/techcity/devwork/rightbiz-category-verifier-system/node_modules/gl',
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! /bin/sh: python: command not found
npm ERR! gyp: Call to 'python commit_id.py check ..' returned exit status 127 while in angle/src/angle.gyp. while loading dependencies of binding.gyp while trying to load binding.gyp
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.onCpExit (/Users/techcity/devwork/rightbiz-category-verifier-system/node_modules/node-gyp/lib/configure.js:325:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Darwin 21.6.0
npm ERR! gyp ERR! command "/usr/local/bin/node" "/Users/techcity/devwork/rightbiz-category-verifier-system/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /Users/techcity/devwork/rightbiz-category-verifier-system/node_modules/gl
npm ERR! gyp ERR! node -v v18.6.0
npm ERR! gyp ERR! node-gyp -v v9.3.1
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in: /Users/techcity/.npm/_logs/2023-04-26T12_10_01_644Z-debug-0.log

I Faced this problem when trying to install brain.js by npm

splurgebudget commented 1 year ago

Same here. Even though the script claims to find python3 it then seems to call python for some reason (which doesn't exist on many distros anymore).

If you're on Ubuntu you can try sudo apt-get install python-is-python3 to install a system-wide link from python->python3