superhero-com / superhero-wallet

Superhero is a multi-blockchain wallet to manage crypto assets and navigate the web3 and DeFi space. Currently supporting Bitcoin, Ethereum and æternity blockchains.
https://wallet.superhero.com
ISC License
40 stars 38 forks source link

Can't install dependencies on node@16, npm@8, macOS #1398

Closed davidyuk closed 9 months ago

davidyuk commented 2 years ago
$ node --version
v16.13.0
$ npm --version
8.1.3
$ sw_vers
ProductName:    macOS
ProductVersion: 12.1
BuildVersion:   21C52
$ npm ci
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm WARN old lockfile vue-loader-v16: No matching version found for vue-loader-v16@16.8.3.
...
npm WARN old lockfile Error: git dep preparation failed
...
npm WARN deprecated messageformat@2.3.0: Package renamed as '@messageformat/core', see messageformat.github.io for more details. 'messageformat' will eventually provide a polyfill for Intl.MessageFormat, once it's been defined by Unicode & ECMA.
npm WARN deprecated axios@0.19.2: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi'
npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
npm ERR! Cannot convert undefined or null to object

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/denis/.npm/_logs/2021-12-27T14_00_20_503Z-debug.log
$ cat /Users/denis/.npm/_logs/2021-12-27T14_00_20_503Z-debug.log
...
8566 timing reifyNode:node_modules/sass Completed in 22330ms
8567 timing reifyNode:node_modules/swagger-client Completed in 22446ms
8568 timing reifyNode:node_modules/validator Completed in 22627ms
8569 http fetch GET 200 https://registry.npmjs.org/cordova-plugin-openwith 373ms (cache revalidated)
8570 timing metavuln:packument:cordova-plugin-openwith Completed in 373ms
8571 verbose stack TypeError: Cannot convert undefined or null to object
8571 verbose stack     at Function.keys (<anonymous>)
8571 verbose stack     at Advisory.load (/usr/local/lib/node_modules/npm/node_modules/@npmcli/metavuln-calculator/lib/advisory.js:102:33)
8571 verbose stack     at Calculator.[calculate] (/usr/local/lib/node_modules/npm/node_modules/@npmcli/metavuln-calculator/lib/index.js:59:14)
8571 verbose stack     at async Promise.all (index 0)
8571 verbose stack     at async Map.[init] (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/audit-report.js:192:7)
8571 verbose stack     at async Map.run (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/audit-report.js:110:7)
8572 verbose cwd /Users/denis/Documents/superhero-wallet
8573 verbose Darwin 21.2.0
8574 verbose argv "/usr/local/Cellar/node@16/16.13.0/libexec/node" "/usr/local/bin/npm" "ci"
8575 verbose node v16.13.0
8576 verbose npm  v8.1.3
8577 error Cannot convert undefined or null to object
8578 verbose exit 1

is it a problem with cordova-plugin-openwith package?

davidyuk commented 2 years ago
$ node -v                                      
v16.16.0
$ npm -v
8.10.0
$ sw_vers
ProductName:    macOS
ProductVersion: 12.4
BuildVersion:   21F79
$ npm i                                        
npm ERR! code 1
npm ERR! path /Users/denis/Documents/superhero-wallet/node_modules/sharp
npm ERR! command failed
npm ERR! command sh -c (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
npm ERR! sharp: Detected globally-installed libvips v8.12.2
npm ERR! sharp: Building from source via node-gyp
npm ERR! make: Entering directory '/Users/denis/Documents/superhero-wallet/node_modules/sharp/build'
npm ERR!   CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
npm ERR!   LIBTOOL-STATIC Release/nothing.a
npm ERR! make: Leaving directory '/Users/denis/Documents/superhero-wallet/node_modules/sharp/build'
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@16.16.0 | darwin | x64
npm ERR! gyp info find Python using Python version 3.9.13 found at "/usr/local/opt/python@3.9/bin/python3.9"
npm ERR! (node:98170) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
npm ERR! (Use `node --trace-deprecation ...` to show where the warning was created)
npm ERR! gyp info spawn /usr/local/opt/python@3.9/bin/python3.9
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/Users/denis/Documents/superhero-wallet/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/denis/Documents/superhero-wallet/node_modules/sharp/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/denis/Documents/superhero-wallet/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/denis/Library/Caches/node-gyp/16.16.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/denis/Library/Caches/node-gyp/16.16.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/Users/denis/Documents/superhero-wallet/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/denis/Library/Caches/node-gyp/16.16.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Users/denis/Documents/superhero-wallet/node_modules/sharp',
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! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! env: python: No such file or directory
npm ERR! make: *** [../node-addon-api/nothing.target.mk:160: Release/nothing.a] Error 127
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/Users/denis/Documents/superhero-wallet/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Darwin 21.5.0
npm ERR! gyp ERR! command "/usr/local/Cellar/node@16/16.16.0/bin/node" "/Users/denis/Documents/superhero-wallet/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /Users/denis/Documents/superhero-wallet/node_modules/sharp
npm ERR! gyp ERR! node -v v16.16.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/denis/.npm/_logs/2022-07-21T14_10_13_058Z-debug-0.log
$ python      
zsh: command not found: python

python2 is deprecated and it is quite tricky to install in macOS: https://stackoverflow.com/questions/60298514/how-to-reinstall-python2-from-homebrew

Potentially, it can be fixed by

npm i github:ionic-team/capacitor-assets#dependabot/npm_and_yarn/sharp-0.30.7 -D

but seems even the latest version of sharp is not copatible with node@16.16, it triggers the build process that depends on python :/

davidyuk commented 9 months ago

works fine on

$ node -v
v20.11.0
$ npm -v       
10.2.4