Can't install web3 on webstorm(on mac) - node.js

I can't install web3(1.2.4) on webstorm(on mac). I tried re-install webstorm, but it didn't work. My environment is mac os(10.14.6) & webstorm(2019.2.4).
Error messages are as follows:
/Users/Pierogi/Library/Preferences/WebStorm2019.2/node/node-v10.16.0-darwin-x64/bin/node /Users/Pierogi/Library/Preferences/WebStorm2019.2/node/node-v10.16.0-darwin-x64/lib/node_modules/npm/bin/npm-cli.js install web3#1.2.4
Standard error:
npm WARN deprecated #types/bignumber.js#5.0.0: This is a stub types definition for bignumber.js (https://github.com/MikeMcl/bignumber.js/). bignumber.js provides its own type definitions, so you don't need #types/bignumber.js installed!
npm WARN lifecycle The node binary used for scripts is /usr/local/bin/node but npm is using /Users/Pierogi/Library/Preferences/WebStorm2019.2/node/node-v10.16.0-darwin-x64/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
In file included from ../src/addon.cpp:9:
In file included from ../src/KeccakNISTInterface.h:17:
../src/KeccakSponge.h:23:9: warning: 'ALIGN' macro redefined [-Wmacro-redefined]
#define ALIGN __attribute__ ((aligned(32)))
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/i386/param.h:83:9: note: previous definition is here
#define ALIGN(p) __DARWIN_ALIGN(p)
^
../src/addon.cpp:83:11: error: no matching member function for call to 'Set'
target->Set(className, f);
~~~~~~~~^~~
/Users/Pierogi/Library/Caches/node-gyp/13.1.0/include/node/v8.h:3424:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
^
/Users/Pierogi/Library/Caches/node-gyp/13.1.0/include/node/v8.h:3427:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
^
1 warning and 1 error generated.
make: *** [Release/obj.target/sha3/src/addon.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/Pierogi/Library/Preferences/WebStorm2019.2/node/node-v10.16.0-darwin-x64/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:210:5)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 18.7.0
gyp ERR! command "/usr/local/Cellar/node/13.1.0/bin/node" "/Users/Pierogi/Library/Preferences/WebStorm2019.2/node/node-v10.16.0-darwin-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/Pierogi/Documents/WebStorm project/191112/node_modules/sha3
gyp ERR! node -v v13.1.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm WARN bookshelf#1.0.1 requires a peer of knex#>=0.15.0 <0.20.0 but none is installed. You must install peer dependencies yourself.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sha3#1.2.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sha3#1.2.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/Pierogi/.npm/_logs/2019-11-19T13_11_28_555Z-debug.log
Standard output:
> sha3#1.2.3 install /Users/Pierogi/Documents/WebStorm project/191112/node_modules/sha3
> node-gyp rebuild
CXX(target) Release/obj.target/sha3/src/addon.o
Process finished with exit code 1

Try to install compilers and some supporting utilities by running:
xcode-select --install

Related

how can install local-npm for having offline registery and repo for npm

I would like to have offline npm registery (like local repository) for npm modules
so I search and realized local-npm is a good idea for this.
I tried to install it but I have some problem.
I have error in installing local-npm
my command is
npm install -g local-npm --unsafe-perm=true --allow-root
and my error is:
../../nan/nan_object_wrap.h:66:61: required from here
/home/itis/.cache/node-gyp/10.24.0/include/node/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<Nan::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
make: *** [leveldown.target.mk:119: Release/obj.target/leveldown/src/batch.o] Error 1
make: Leaving directory '/usr/local/lib/node_modules/local-npm/node_modules/leveldown/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:191:23)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 4.18.0-348.el8.x86_64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/local-npm/node_modules/leveldown
gyp ERR! node -v v10.24.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! leveldown#1.7.2 install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the leveldown#1.7.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/itis/.npm/_logs/2023-01-19T11_02_43_168Z-debug.log```

code is not running after re-downloading code from github

So i made a mistake on my code.
then I downloaded my code from stable version I had on git.
now I cant run it.
i tried to install the packages using npm install but I am getting this error
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: mean-course#0.0.0
npm ERR! Found: zone.js#0.8.29
npm ERR! node_modules/zone.js
npm ERR! zone.js#"^0.8.26" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer zone.js#"~0.9.1" from #angular/core#8.2.14
npm ERR! node_modules/#angular/core
npm ERR! #angular/core#"^8.0.0" from the root project
npm ERR! peer #angular/core#">=2.3.1 <10.0.0 || >9.0.0-beta <10.0.0 || >9.1.0-beta <10.0.0 || >9.2.0-beta <10.0.0" from codelyzer#5.2.2
npm ERR! node_modules/codelyzer
npm ERR! dev codelyzer#"^5.0.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/juan/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/juan/.npm/_logs/2022-12-17T19_54_52_433Z-debug-0.log
I tried to run the code using npm install --legacy-peer-deps and I get the following error:
(base) juan#juans-Air-2 final % npm install --legacy-peer-deps
npm WARN deprecated bcrypt#2.0.1: versions < v5.0.0 do not handle NUL in passwords properly
npm WARN deprecated date-format#2.1.0: 2.x is no longer supported. Please upgrade to 4.x or higher.
npm WARN deprecated log4js#4.5.1: 4.x is no longer supported. Please upgrade to 6.x or higher.
npm WARN deprecated streamroller#1.0.6: 1.x is no longer supported. Please upgrade to 3.x or higher.
npm WARN deprecated protractor#5.4.4: We have news to share - Protractor is deprecated and will reach end-of-life by Summer 2023. To learn more and find out about other options please refer to this post on the Angular blog. Thank you for using and contributing to Protractor. https://goo.gle/state-of-e2e-in-angular
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated source-map-url#0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated source-map-resolve#0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated sourcemap-codec#1.4.8: Please use #jridgewell/sourcemap-codec instead
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated readdir-scoped-modules#1.1.0: This functionality has been moved to #npmcli/fs
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated read-package-tree#5.3.1: The functionality that this package provided is now in #npmcli/arborist
npm WARN deprecated querystring#0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated node-fetch-npm#2.0.4: This module is not used anymore, npm uses minipass-fetch for its fetch implementation now
npm WARN deprecated multer#1.4.4: Multer 1.x is affected by CVE-2022-24434. This is fixed in v1.4.4-lts.1 which drops support for versions of Node.js before 6. Please upgrade to at least Node.js 6 and version 1.4.4-lts.1 of Multer. If you need support for older versions of Node.js, we are open to accepting patches that would fix the CVE on the main 1.x release line, whilst maintaining compatibility with Node.js 0.10.
npm WARN deprecated json3#3.3.2: Please use the native JSON object instead of JSON 3
npm WARN deprecated ini#1.3.5: Please update to ini >=1.3.6 to avoid a prototype pollution issue
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
npm WARN deprecated fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated chokidar#2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated acorn-dynamic-import#4.0.0: This is probably built in to whatever tool you're using. If you still need it... idk
npm WARN deprecated #schematics/update#0.803.29: This was an internal-only Angular package up through Angular v11 which is no longer used or maintained. Upgrade Angular to v12+ to remove this dependency.
npm WARN deprecated core-js#2.6.12: core-js#<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated core-js#2.6.12: core-js#<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated core-js#3.0.1: core-js#<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm ERR! code 1
npm ERR! path /Users/juan/Desktop/final/node_modules/bcrypt
npm ERR! command failed
npm ERR! command sh /var/folders/lh/nl1xy3g132748mjl5h0j3gsc0000gn/T/install-3acd8054.sh
npm ERR! CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
npm ERR! CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
npm ERR! CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
npm ERR! Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/juan/Desktop/final/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/Users/juan/Desktop/final/node_modules/bcrypt/lib/binding --napi_version=8 --node_abi_napi=napi' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp#0.9.1
npm ERR! node-pre-gyp info using node#16.17.0 | darwin | arm64
npm ERR! node-pre-gyp info check checked for "/Users/juan/Desktop/final/node_modules/bcrypt/lib/binding/bcrypt_lib.node" (not found)
npm ERR! node-pre-gyp http GET https://github.com/kelektiv/node.bcrypt.js/releases/download/v2.0.1/bcrypt_lib-v2.0.1-node-v93-darwin-arm64-unknown.tar.gz
npm ERR! node-pre-gyp http 404 https://github.com/kelektiv/node.bcrypt.js/releases/download/v2.0.1/bcrypt_lib-v2.0.1-node-v93-darwin-arm64-unknown.tar.gz
npm ERR! node-pre-gyp ERR! Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v2.0.1/bcrypt_lib-v2.0.1-node-v93-darwin-arm64-unknown.tar.gz
npm ERR! node-pre-gyp ERR! Pre-built binaries not found for bcrypt#2.0.1 and node#16.17.0 (node-v93 ABI, unknown) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp http 404 status code downloading tarball https://github.com/kelektiv/node.bcrypt.js/releases/download/v2.0.1/bcrypt_lib-v2.0.1-node-v93-darwin-arm64-unknown.tar.gz
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp#9.0.0
npm ERR! gyp info using node#16.17.0 | darwin | arm64
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp#9.0.0
npm ERR! gyp info using node#16.17.0 | darwin | arm64
npm ERR! gyp info find Python using Python version 3.11.1 found at "/Library/Frameworks/Python.framework/Versions/3.11/bin/python3"
npm ERR! gyp info spawn /Library/Frameworks/Python.framework/Versions/3.11/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/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/juan/Desktop/final/node_modules/bcrypt/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/juan/Library/Caches/node-gyp/16.17.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/juan/Library/Caches/node-gyp/16.17.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/juan/Library/Caches/node-gyp/16.17.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/Users/juan/Desktop/final/node_modules/bcrypt',
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 ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp#9.0.0
npm ERR! gyp info using node#16.17.0 | darwin | arm64
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In file included from ../src/bcrypt_node.cc:1:
npm ERR! In file included from ../node_modules/nan/nan.h:202:
npm ERR! In file included from ../node_modules/nan/nan_converters.h:67:
npm ERR! ../node_modules/nan/nan_converters_43_inl.h:22:1: error: no viable conversion from 'Local<v8::Context>' to 'v8::Isolate *'
npm ERR! X(Boolean)
npm ERR! ^~~~~~~~~~
npm ERR! ../node_modules/nan/nan_converters_43_inl.h:18:23: note: expanded from macro 'X'
npm ERR! val->To ## TYPE(isolate->GetCurrentContext()) \
npm ERR! ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! /Users/juan/Library/Caches/node-gyp/16.17.0/include/node/v8.h:3086:37: note: passing argument to parameter 'isolate' here
npm ERR! Local<Boolean> ToBoolean(Isolate* isolate) const;
npm ERR! ^
npm ERR! In file included from ../src/bcrypt_node.cc:1:
npm ERR! In file included from ../node_modules/nan/nan.h:202:
npm ERR! In file included from ../node_modules/nan/nan_converters.h:67:
npm ERR! ../node_modules/nan/nan_converters_43_inl.h:22:1: error: no member named 'FromMaybe' in 'v8::Local<v8::Boolean>'
npm ERR! X(Boolean)
npm ERR! ^~~~~~~~~~
npm ERR! ../node_modules/nan/nan_converters_43_inl.h:19:12: note: expanded from macro 'X'
npm ERR! .FromMaybe(v8::Local<v8::TYPE>())); \
npm ERR! ^
npm ERR! ../node_modules/nan/nan_converters_43_inl.h:40:1: error: no viable conversion from 'Local<v8::Context>' to 'v8::Isolate *'
npm ERR! X(bool, Boolean)
npm ERR! ^~~~~~~~~~~~~~~~
npm ERR! ../node_modules/nan/nan_converters_43_inl.h:37:29: note: expanded from macro 'X'
npm ERR! return val->NAME ## Value(isolate->GetCurrentContext()); \
npm ERR! ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! /Users/juan/Library/Caches/node-gyp/16.17.0/include/node/v8.h:3096:30: note: passing argument to parameter 'isolate' here
npm ERR! bool BooleanValue(Isolate* isolate) const;
npm ERR! ^
npm ERR! In file included from ../src/bcrypt_node.cc:1:
npm ERR! In file included from ../node_modules/nan/nan.h:202:
npm ERR! In file included from ../node_modules/nan/nan_converters.h:67:
npm ERR! ../node_modules/nan/nan_converters_43_inl.h:40:1: error: no viable conversion from returned value of type 'bool' to function return type 'imp::ToFactory<bool>::return_t' (aka 'Maybe<bool>')
npm ERR! X(bool, Boolean)
npm ERR! ^~~~~~~~~~~~~~~~
npm ERR! ../node_modules/nan/nan_converters_43_inl.h:37:10: note: expanded from macro 'X'
npm ERR! return val->NAME ## Value(isolate->GetCurrentContext()); \
npm ERR! ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! /Users/juan/Library/Caches/node-gyp/16.17.0/include/node/v8.h:10437:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'bool' to 'const v8::Maybe<bool> &' for 1st argument
npm ERR! class Maybe {
npm ERR! ^
npm ERR! /Users/juan/Library/Caches/node-gyp/16.17.0/include/node/v8.h:10437:7: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'bool' to 'v8::Maybe<bool> &&' for 1st argument
npm ERR! /Users/juan/Library/Caches/node-gyp/16.17.0/include/node/v8.h:10492:12: note: explicit constructor is not a candidate
npm ERR! explicit Maybe(const T& t) : has_value_(true), value_(t) {}
npm ERR! ^
npm ERR! In file included from ../src/bcrypt_node.cc:1:
npm ERR! In file included from ../node_modules/nan/nan.h:203:
npm ERR! In file included from ../node_modules/nan/nan_new.h:189:
npm ERR! ../node_modules/nan/nan_implementation_12_inl.h:103:42: error: no viable conversion from 'v8::Isolate *' to 'Local<v8::Context>'
npm ERR! return scope.Escape(v8::Function::New( isolate
npm ERR! ^~~~~~~
npm ERR! /Users/juan/Library/Caches/node-gyp/16.17.0/include/node/v8.h:200:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'v8::Isolate *' to 'const v8::Local<v8::Context> &' for 1st argument
npm ERR! class Local {
npm ERR! ^
npm ERR! /Users/juan/Library/Caches/node-gyp/16.17.0/include/node/v8.h:200:7: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'v8::Isolate *' to 'v8::Local<v8::Context> &&' for 1st argument
npm ERR! /Users/juan/Library/Caches/node-gyp/16.17.0/include/node/v8.h:204:13: note: candidate template ignored: could not match 'Local<type-parameter-0-0>' against 'v8::Isolate *'
npm ERR! V8_INLINE Local(Local<S> that)
npm ERR! ^
npm ERR! /Users/juan/Library/Caches/node-gyp/16.17.0/include/node/v8.h:348:22: note: explicit constructor is not a candidate
npm ERR! explicit V8_INLINE Local(T* that) : val_(that) {}
npm ERR! ^
npm ERR! /Users/juan/Library/Caches/node-gyp/16.17.0/include/node/v8.h:4754:22: note: passing argument to parameter 'context' here
npm ERR! Local<Context> context, FunctionCallback callback,
npm ERR! ^
npm ERR! In file included from ../src/bcrypt_node.cc:1:
npm ERR! In file included from ../node_modules/nan/nan.h:203:
npm ERR! In file included from ../node_modules/nan/nan_new.h:189:
npm ERR! ../node_modules/nan/nan_implementation_12_inl.h:337:37: error: too few arguments to function call, expected 2, have 1
npm ERR! return v8::StringObject::New(value).As<v8::StringObject>();
npm ERR! ~~~~~~~~~~~~~~~~~~~~~ ^
npm ERR! /Users/juan/Library/Caches/node-gyp/16.17.0/include/node/v8.h:6196:23: note: 'New' declared here
npm ERR! static Local<Value> New(Isolate* isolate, Local<String> value);
npm ERR! ^
npm ERR! In file included from ../src/bcrypt_node.cc:1:
npm ERR! ../node_modules/nan/nan.h:1034:53: error: too few arguments to function call, single argument 'context' was not specified
npm ERR! v8::Local<v8::String> string = from->ToString();
npm ERR! ~~~~~~~~~~~~~~ ^
npm ERR! /Users/juan/Library/Caches/node-gyp/16.17.0/include/node/v8.h:3048:44: note: 'ToString' declared here
npm ERR! V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
npm ERR! ^
npm ERR! In file included from ../src/bcrypt_node.cc:1:
npm ERR! ../node_modules/nan/nan.h:1034:29: error: no viable conversion from 'MaybeLocal<v8::String>' to 'v8::Local<v8::String>'
npm ERR! v8::Local<v8::String> string = from->ToString();
npm ERR! ^ ~~~~~~~~~~~~~~~~
npm ERR! /Users/juan/Library/Caches/node-gyp/16.17.0/include/node/v8.h:200:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'MaybeLocal<v8::String>' to 'const v8::Local<v8::String> &' for 1st argument
npm ERR! class Local {
npm ERR! ^
npm ERR! /Users/juan/Library/Caches/node-gyp/16.17.0/include/node/v8.h:200:7: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'MaybeLocal<v8::String>' to 'v8::Local<v8::String> &&' for 1st argument
npm ERR! /Users/juan/Library/Caches/node-gyp/16.17.0/include/node/v8.h:204:13: note: candidate template ignored: could not match 'Local' against 'MaybeLocal'
npm ERR! V8_INLINE Local(Local<S> that)
npm ERR! ^
npm ERR! /Users/juan/Library/Caches/node-gyp/16.17.0/include/node/v8.h:348:22: note: explicit constructor is not a candidate
npm ERR! explicit V8_INLINE Local(T* that) : val_(that) {}
npm ERR! ^
npm ERR! In file included from ../src/bcrypt_node.cc:1:
npm ERR! ../node_modules/nan/nan.h:1044:37: error: cannot initialize a parameter of type 'v8::Isolate *' with an lvalue of type 'char *'
npm ERR! length_ = string->WriteUtf8(str_, static_cast<int>(len), 0, flags);
npm ERR! ^~~~
npm ERR! /Users/juan/Library/Caches/node-gyp/16.17.0/include/node/v8.h:3277:26: note: passing argument to parameter 'isolate' here
npm ERR! int WriteUtf8(Isolate* isolate, char* buffer, int length = -1,
npm ERR! ^
npm ERR! In file included from ../src/bcrypt_node.cc:1:
npm ERR! ../node_modules/nan/nan.h:1818:28: error: no matching member function for call to 'Set'
npm ERR! New(persistentHandle)->Set(New(key).ToLocalChecked(), value);
npm ERR! ~~~~~~~~~~~~~~~~~~~~~~~^~~
npm ERR! /Users/juan/Library/Caches/node-gyp/16.17.0/include/node/v8.h:3961:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR! V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR! ^
npm ERR! /Users/juan/Library/Caches/node-gyp/16.17.0/include/node/v8.h:3964:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR! V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR! ^
npm ERR! In file included from ../src/bcrypt_node.cc:1:
npm ERR! ../node_modules/nan/nan.h:1824:28: error: no matching member function for call to 'Set'
npm ERR! New(persistentHandle)->Set(key, value);
npm ERR! ~~~~~~~~~~~~~~~~~~~~~~~^~~
npm ERR! /Users/juan/Library/Caches/node-gyp/16.17.0/include/node/v8.h:3961:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR! V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR! ^
npm ERR! /Users/juan/Library/Caches/node-gyp/16.17.0/include/node/v8.h:3964:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR! V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR! ^
npm ERR! In file included from ../src/bcrypt_node.cc:1:
npm ERR! ../node_modules/nan/nan.h:1830:28: error: no matching member function for call to 'Set'
npm ERR! New(persistentHandle)->Set(index, value);
npm ERR! ~~~~~~~~~~~~~~~~~~~~~~~^~~
npm ERR! /Users/juan/Library/Caches/node-gyp/16.17.0/include/node/v8.h:3961:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR! V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR! ^
npm ERR! /Users/juan/Library/Caches/node-gyp/16.17.0/include/node/v8.h:3964:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR! V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR! ^
npm ERR! In file included from ../src/bcrypt_node.cc:1:
npm ERR! ../node_modules/nan/nan.h:1836:32: error: no matching member function for call to 'Get'
npm ERR! New(persistentHandle)->Get(New(key).ToLocalChecked()));
npm ERR! ~~~~~~~~~~~~~~~~~~~~~~~^~~
npm ERR! /Users/juan/Library/Caches/node-gyp/16.17.0/include/node/v8.h:4007:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
npm ERR! V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
npm ERR! ^
npm ERR! /Users/juan/Library/Caches/node-gyp/16.17.0/include/node/v8.h:4010:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
npm ERR! V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
npm ERR! ^
npm ERR! In file included from ../src/bcrypt_node.cc:1:
npm ERR! ../node_modules/nan/nan.h:1842:48: error: no matching member function for call to 'Get'
npm ERR! return scope.Escape(New(persistentHandle)->Get(key));
npm ERR! ~~~~~~~~~~~~~~~~~~~~~~~^~~
npm ERR! /Users/juan/Library/Caches/node-gyp/16.17.0/include/node/v8.h:4007:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
npm ERR! V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
npm ERR! ^
npm ERR! /Users/juan/Library/Caches/node-gyp/16.17.0/include/node/v8.h:4010:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
npm ERR! V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
npm ERR! ^
npm ERR! In file included from ../src/bcrypt_node.cc:1:
npm ERR! ../node_modules/nan/nan.h:1847:48: error: no matching member function for call to 'Get'
npm ERR! return scope.Escape(New(persistentHandle)->Get(index));
npm ERR! ~~~~~~~~~~~~~~~~~~~~~~~^~~
npm ERR! /Users/juan/Library/Caches/node-gyp/16.17.0/include/node/v8.h:4007:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
npm ERR! V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
npm ERR! ^
npm ERR! /Users/juan/Library/Caches/node-gyp/16.17.0/include/node/v8.h:4010:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
npm ERR! V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
npm ERR! ^
npm ERR! In file included from ../src/bcrypt_node.cc:1:
npm ERR! In file included from ../node_modules/nan/nan.h:2657:
npm ERR! ../node_modules/nan/nan_object_wrap.h:24:25: error: no member named 'IsNearDeath' in 'Nan::Persistent<v8::Object>'
npm ERR! assert(persistent().IsNearDeath());
npm ERR! ~~~~~~~~~~~~ ^
npm ERR! /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/assert.h:99:25: note: expanded from macro 'assert'
npm ERR! (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __ASSERT_FILE_NAME, __LINE__, #e) : (void)0)
npm ERR! ^
npm ERR! In file included from ../src/bcrypt_node.cc:1:
npm ERR! In file included from ../node_modules/nan/nan.h:2657:
npm ERR! ../node_modules/nan/nan_object_wrap.h:67:18: error: no member named 'MarkIndependent' in 'Nan::Persistent<v8::Object>'
npm ERR! persistent().MarkIndependent();
npm ERR! ~~~~~~~~~~~~ ^
npm ERR! ../node_modules/nan/nan_object_wrap.h:124:26: error: no member named 'IsNearDeath' in 'Nan::Persistent<v8::Object>'
npm ERR! assert(wrap->handle_.IsNearDeath());
npm ERR! ~~~~~~~~~~~~~ ^
npm ERR! /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/assert.h:99:25: note: expanded from macro 'assert'
npm ERR! (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __ASSERT_FILE_NAME, __LINE__, #e) : (void)0)
npm ERR! ^
npm ERR! In file included from ../src/bcrypt_node.cc:1:
npm ERR! In file included from ../node_modules/nan/nan.h:2753:
npm ERR! ../node_modules/nan/nan_typedarray_contents.h:34:43: warning: 'GetContents' is deprecated: Use GetBackingStore. See http://crbug.com/v8/9908. [-Wdeprecated-declarations]
npm ERR! data = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
npm ERR! ^
npm ERR! /Users/juan/Library/Caches/node-gyp/16.17.0/include/node/v8.h:5614:3: note: 'GetContents' has been explicitly marked deprecated here
npm ERR! V8_DEPRECATED("Use GetBackingStore. See http://crbug.com/v8/9908.")
npm ERR! ^
npm ERR! /Users/juan/Library/Caches/node-gyp/16.17.0/include/node/v8config.h:454:35: note: expanded from macro 'V8_DEPRECATED'
npm ERR! # define V8_DEPRECATED(message) [[deprecated(message)]]
npm ERR! ^
npm ERR! ../src/bcrypt_node.cc:66:21: error: no matching constructor for initialization of 'String::Utf8Value'
npm ERR! String::Utf8Value value(str);
npm ERR! ^ ~~~
npm ERR! /Users/juan/Library/Caches/node-gyp/16.17.0/include/node/v8.h:3588:5: note: candidate constructor not viable: no known conversion from 'Local<v8::String>' to 'const v8::String::Utf8Value' for 1st argument
npm ERR! Utf8Value(const Utf8Value&) = delete;
npm ERR! ^
npm ERR! /Users/juan/Library/Caches/node-gyp/16.17.0/include/node/v8.h:3581:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
npm ERR! Utf8Value(Isolate* isolate, Local<v8::Value> obj);
npm ERR! ^
npm ERR! fatal error: too many errors emitted, stopping now [-ferror-limit=]
npm ERR! 1 warning and 20 errors generated.
npm ERR! make: *** [Release/obj.target/bcrypt_lib/src/bcrypt_node.o] Error 1
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 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack at Process.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" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/juan/Desktop/final/node_modules/bcrypt/lib/binding/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/Users/juan/Desktop/final/node_modules/bcrypt/lib/binding" "--napi_version=8" "--node_abi_napi=napi"
npm ERR! gyp ERR! cwd /Users/juan/Desktop/final/node_modules/bcrypt
npm ERR! gyp ERR! node -v v16.17.0
npm ERR! gyp ERR! node-gyp -v v9.0.0
npm ERR! gyp ERR! not ok
npm ERR! node-pre-gyp ERR! build error
npm ERR! node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/juan/Desktop/final/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/Users/juan/Desktop/final/node_modules/bcrypt/lib/binding --napi_version=8 --node_abi_napi=napi' (1)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/Users/juan/Desktop/final/node_modules/bcrypt/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.emit (node:events:513:28)
npm ERR! node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1093:16)
npm ERR! node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
npm ERR! node-pre-gyp ERR! System Darwin 21.6.0
npm ERR! node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/juan/Desktop/final/node_modules/bcrypt/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd /Users/juan/Desktop/final/node_modules/bcrypt
npm ERR! node-pre-gyp ERR! node -v v16.17.0
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v0.9.1
npm ERR! node-pre-gyp ERR! not ok
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/juan/.npm/_logs/2022-12-17T19_57_40_323Z-debug-0.log
I have no clue what is going on here :(
the code was working 2 days ago. now its not working at all

Error while downloading certain NPM packages

I'm trying to download certain packages like node-portaudio and image-to-ascii but an error is occuring. While there are many other packages that are being downloaded wothout any errors.
The error shown is :
> node-portaudio#0.4.10 install /home/ex-machina/Desktop/Project/node_modules/node-portaudio
> node-gyp rebuild
make: Entering directory '/home/ex-machina/Desktop/Project/node_modules/node-portaudio/build'
COPY ../build/Release/libportaudio.so.2
CXX(target) Release/obj.target/node_pa/src/node_pa.o
CXX(target) Release/obj.target/node_pa/src/GetDevices.o
CXX(target) Release/obj.target/node_pa/src/AudioIn.o
In file included from ../src/AudioIn.cc:20:0:
../src/Params.h: In member function ‘std::__cxx11::string streampunk::Params::unpackValue(v8::Local<v8::Value>)’:
../src/Params.h:41:48: warning: ‘v8::Local<v8::Value> v8::Object::Get(uint32_t)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
return *String::Utf8Value(valueArray->Get(0));
^
In file included from /home/ex-machina/.cache/node-gyp/12.17.0/include/node/v8-internal.h:14:0,
from /home/ex-machina/.cache/node-gyp/12.17.0/include/node/v8.h:27,
from /home/ex-machina/.cache/node-gyp/12.17.0/include/node/node.h:67,
from ../../nan/nan.h:56,
from ../src/AudioIn.cc:16:
/home/ex-machina/.cache/node-gyp/12.17.0/include/node/v8.h:3557:51: note:declared here
V8_DEPRECATED("Use maybe version", Local<Value> Get(uint32_t index));
^
/home/ex-machina/.cache/node-gyp/12.17.0/include/node/v8config.h:328:3: note: in definition of macro ‘V8_DEPRECATED’
declarator __attribute__((deprecated(message)))
^~~~~~~~~~
In file included from ../src/AudioIn.cc:20:0:
../src/Params.h:41:49: error: no matching function for call to ‘v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>)’
return *String::Utf8Value(valueArray->Get(0));
^
In file included from /home/ex-machina/.cache/node-gyp/12.17.0/include/node/node.h:67:0,
from ../../nan/nan.h:56,
from ../src/AudioIn.cc:16:
/home/ex-machina/.cache/node-gyp/12.17.0/include/node/v8.h:3135:5: note: candidate: v8::String::Utf8Value::Utf8Value(v8::Isolate*, v8::Local<v8::Value>)
Utf8Value(Isolate* isolate, Local<v8::Value> obj);
^~~~~~~~~
/home/ex-machina/.cache/node-gyp/12.17.0/include/node/v8.h:3135:5: note: candidate expects 2 arguments, 1 provided
In file included from ../src/AudioIn.cc:20:0:
../src/Params.h: In member function ‘std::__cxx11::string streampunk::Params::unpackStr(v8::Local<v8::Object>, const string&, std::__cxx11::string)’:
../src/Params.h:64:38: error: no matching function for call to ‘v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>&)’
result = *String::Utf8Value(val);
^
In file included from /home/ex-machina/.cache/node-gyp/12.17.0/include/node/node.h:67:0,
from ../../nan/nan.h:56,
from ../src/AudioIn.cc:16:
/home/ex-machina/.cache/node-gyp/12.17.0/include/node/v8.h:3135:5: note: candidate: v8::String::Utf8Value::Utf8Value(v8::Isolate*, v8::Local<v8::Value>)
Utf8Value(Isolate* isolate, Local<v8::Value> obj);
^~~~~~~~~
/home/ex-machina/.cache/node-gyp/12.17.0/include/node/v8.h:3135:5: note: candidate expects 2 arguments, 1 provided
node_pa.target.mk:128: recipe for target 'Release/obj.target/node_pa/src/AudioIn.o' failed
make: *** [Release/obj.target/node_pa/src/AudioIn.o] Error 1
make: Leaving directory '/home/ex-machina/Desktop/Project/node_modules/node-portaudio/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/ex-machina/.nvm/versions/node/v12.17.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 5.3.0-51-generic
gyp ERR! command "/home/ex-machina/.nvm/versions/node/v12.17.0/bin/node" "/home/ex-machina/.nvm/versions/node/v12.17.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/ex-machina/Desktop/Project/node_modules/node-portaudio
gyp ERR! node -v v12.17.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN project#1.0.0 No description
npm WARN project#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-portaudio#0.4.10 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-portaudio#0.4.10 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ex-machina/.npm/_logs/2020-06-06T18_22_49_191Z-debug.log
I dont understand what's wrong. This is happening to only few packages. I've tried adding sudo but it doesn't work. How to resolve this?
This error could be because of Node JS Version installed on your machine. can you try updating the version or checking the version supported by that plugin

node-zopfli error: Failed at the node-zopfli#1.4.0 install script

while upgrading the node version from 8 to 12, node-zopfli installation is failing with below errors:
from ../src/zopfli-binding.cc:1:
/home/.cache/node-gyp/12.16.1/include/node/v8.h:2672:44: note: candidate: v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const
V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
^~~~~~~~
/home/.cache/node-gyp/12.16.1/include/node/v8.h:2672:44: note: candidate expects 1 argument, 0 provided
In file included from /home/.cache/node-gyp/12.16.1/include/node/v8-internal.h:14:0,
from /home/.cache/node-gyp/12.16.1/include/node/v8.h:27,
from /home/.cache/node-gyp/12.16.1/include/node/node.h:63,
from ../src/zopfli-binding.cc:1:
/home/.cache/node-gyp/12.16.1/include/node/v8.h:2686:31: note: candidate: v8::Local<v8::Object> v8::Value::ToObject(v8::Isolate*) const
Local<Object> ToObject(Isolate* isolate) const);
^
/home/.cache/node-gyp/12.16.1/include/node/v8config.h:328:3: note: in definition of macro ‘V8_DEPRECATED’
declarator __attribute__((deprecated(message)))
^~~~~~~~~~
/home/.cache/node-gyp/12.16.1/include/node/v8.h:2686:31: note: candidate expects 1 argument, 0 provided
Local<Object> ToObject(Isolate* isolate) const);
^
/home/.cache/node-gyp/12.16.1/include/node/v8config.h:328:3: note: in definition of macro ‘V8_DEPRECATED’
declarator __attribute__((deprecated(message)))
^~~~~~~~~~
../src/zopfli-binding.cc:209:86: error: no matching function for call to ‘v8::Value::ToObject()’
const unsigned char * data = (const unsigned char*)Buffer::Data(inbuffer->ToObject());
^
In file included from /home/.cache/node-gyp/12.16.1/include/node/node.h:63:0,
from ../src/zopfli-binding.cc:1:
/home/.cache/node-gyp/12.16.1/include/node/v8.h:2672:44: note: candidate:
v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const
V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
^~~~~~~~
/home/.cache/node-gyp/12.16.1/include/node/v8.h:2672:44: note: candidate expects 1 argument, 0 provided
In file included from /home/.cache/node-gyp/12.16.1/include/node/v8-internal.h:14:0,
from /home/.cache/node-gyp/12.16.1/include/node/v8.h:27,
from /home/.cache/node-gyp/12.16.1/include/node/node.h:63,
from ../src/zopfli-binding.cc:1:
/home/.cache/node-gyp/12.16.1/include/node/v8.h:2686:31: note: candidate:
v8::Local<v8::Object> v8::Value::ToObject(v8::Isolate*) const
Local<Object> ToObject(Isolate* isolate) const);
^
/home/.cache/node-gyp/12.16.1/include/node/v8config.h:328:3: note: in definition of macro ‘V8_DEPRECATED’
declarator __attribute__((deprecated(message)))
^~~~~~~~~~
/home/.cache/node-gyp/12.16.1/include/node/v8.h:2686:31: note: candidate expects 1 argument, 0 provided
Local<Object> ToObject(Isolate* isolate) const);
^
/home/.cache/node-gyp/12.16.1/include/node/v8config.h:328:3: note: in definition of macro ‘V8_DEPRECATED’
declarator __attribute__((deprecated(message)))
^~~~~~~~~~
zopfli.target.mk:143: recipe for target 'Release/obj.target/zopfli/src/zopfli-binding.o' failed
make: *** [Release/obj.target/zopfli/src/zopfli-binding.o] Error 1
make: Leaving directory '/home/node_modules/node-zopfli/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/.nvm/versions/node/v12.16.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:311:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 5.3.0-40-generic
gyp ERR! command "/home/.nvm/versions/node/v12.16.1/bin/node" "/home/.nvm/versions/node/v12.16.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/node_modules/node-zopfli/lib/binding/node-v72-linux-x64/zopfli.node" "--module_name=zopfli" "--module_path=/home/node_modules/node-zopfli/lib/binding/node-v72-linux-x64"
gyp ERR! cwd /home/node_modules/node-zopfli
gyp ERR! node -v v12.16.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/home/.nvm/versions/node/v12.16.1/bin/node /home/.nvm/versions/node/v12.16.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/node_modules/node-zopfli/lib/binding/node-v72-linux-x64/zopfli.node --module_name=zopfli --module_path=/home/node_modules/node-zopfli/lib/binding/node-v72-linux-x64' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/home/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:311:20)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1021:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
node-pre-gyp ERR! System Linux 5.3.0-40-generic
node-pre-gyp ERR! command "/home/.nvm/versions/node/v12.16.1/bin/node" "/home/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/node_modules/node-zopfli
node-pre-gyp ERR! node -v v12.16.1
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok
Failed to execute '/home/.nvm/versions/node/v12.16.1/bin/node /home/.nvm/versions/node/v12.16.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/node_modules/node-zopfli/lib/binding/node-v72-linux-x64/zopfli.node --module_name=zopfli --module_path=/home/node_modules/node-zopfli/lib/binding/node-v72-linux-x64' (1)
zopfli.target.mk:143: recipe for target 'Release/obj.target/zopfli/src/zopfli-binding.o' failedl script
make: *** [Release/obj.target/zopfli/src/zopfli-binding.o] Error 1
make: Leaving directory '/home/node_modules/node-zopfli/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/.nvm/versions/node/v12.16.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:311:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 5.3.0-40-generic
gyp ERR! command "/home/.nvm/versions/node/v12.16.1/bin/node" "/home/.nvm/versions/node/v12.16.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/node_modules/node-zopfli/lib/binding/node-v72-linux-x64/zopfli.node" "--module_name=zopfli" "--module_path=/home/node_modules/node-zopfli/lib/binding/node-v72-linux-x64"
gyp ERR! cwd /home/node_modules/node-zopfli
gyp ERR! node -v v12.16.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.11 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-zopfli#1.4.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-zopfli#1.4.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/.npm/_logs/2020-03-16T07_09_26_729Z-debug.log
It's showing the cache issue, checked after clearing the cache and tried updating the same as well as different packages. Still, the same issue is occurring. Is this due to version or anything else. Any solution?
Thanks in advance.
It's been a while since this was asked, and I don't have an explanation, but I do have a possible solution:
Try run:
npm install -g node-gyp#latest
npm update node-sass npm update node scripts
npm rebuild node-sass
npm install --build-from-source node-zopfli
rm -rf node_modules
npm install --save react react-dom react-scripts
npm rebuild node-sass
Now try to run the project.
I'm currently working on an old project. not sure why it's built the way it does, or what is it with node-zopfli#1.4.0, but I'm now able to run the project.

Can I run NPM/NodeJS app on Debian running 8 on OpenVZ?

I want to run rocketchat (a nodejs app) on my Debian 8 VPS. This VPS runs on OpenVZ, so the kernel version is 2.6.32-042stab108.8.
Installing NodeJS as described on nodejs website (their own repo, not the one provided by debian) works without a problem.
However, when i run
npm install
NPM fails to install required packages and prints the following:
npm WARN package.json meteor-dev-bundle#0.0.0 No description
npm WARN package.json meteor-dev-bundle#0.0.0 No repository field.
npm WARN package.json meteor-dev-bundle#0.0.0 No README data
npm WARN package.json meteor-dev-bundle#0.0.0 No license field.
\
> fibers#1.0.5 install /home/rocketchat/rchat/programs/server/node_modules/fibers
> node ./build.js
(node) child_process: options.customFds option is deprecated. Use options.stdio instead.
make: Entering directory '/home/rocketchat/rchat/programs/server/node_modules/fibers/build'
CXX(target) Release/obj.target/fibers/src/fibers.o
../src/fibers.cc: In function 'v8::Handle<v8::Signature> uni::NewSignature(v8::Isolate*, v8::Handle<v8::FunctionTemplate>, int, v8::Handle<v8::FunctionTemplate>*)':
../src/fibers.cc:132:54: error: no matching function for call to 'v8::Signature::New(v8::Isolate*&, v8::Handle<v8::FunctionTemplate>&, int&, v8::Handle<v8::FunctionTemplate>*&)'
return Signature::New(isolate, receiver, argc, argv);
^
../src/fibers.cc:132:54: note: candidate is:
In file included from /home/rocketchat/.node-gyp/4.4.2/include/node/node.h:42:0,
from ../src/coroutine.h:1,
from ../src/fibers.cc:1:
/home/rocketchat/.node-gyp/4.4.2/include/node/v8.h:4675:27: note: static v8::Local<v8::Signature> v8::Signature::New(v8::Isolate*, v8::Local<v8::FunctionTemplate>)
static Local<Signature> New(
^
/home/rocketchat/.node-gyp/4.4.2/include/node/v8.h:4675:27: note: candidate expects 2 arguments, 4 provided
../src/fibers.cc: In function 'void uni::SetResourceConstraints(v8::Isolate*, v8::ResourceConstraints*)':
../src/fibers.cc:140:3: error: 'SetResourceConstraints' is not a member of 'v8'
v8::SetResourceConstraints(isolate, constraints);
^
../src/fibers.cc:140:3: note: suggested alternative:
../src/fibers.cc:139:7: note: 'uni::SetResourceConstraints'
void SetResourceConstraints(Isolate* isolate, ResourceConstraints* constraints) {
^
../src/fibers.cc: In function 'v8::Handle<v8::Signature> uni::NewSignature(v8::Isolate*, v8::Handle<v8::FunctionTemplate>, int, v8::Handle<v8::FunctionTemplate>*)':
../src/fibers.cc:133:2: warning: control reaches end of non-void function [-Wreturn-type]
}
^
fibers.target.mk:97: recipe for target 'Release/obj.target/fibers/src/fibers.o' failed
make: *** [Release/obj.target/fibers/src/fibers.o] Error 1
make: Leaving directory '/home/rocketchat/rchat/programs/server/node_modules/fibers/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 2.6.32-042stab108.8
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
gyp ERR! cwd /home/rocketchat/rchat/programs/server/node_modules/fibers
gyp ERR! node -v v4.4.2
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
Build failed
npm ERR! Linux 2.6.32-042stab108.8
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--build-from-source"
npm ERR! node v4.4.2
npm ERR! npm v2.15.0
npm ERR! code ELIFECYCLE
npm ERR! fibers#1.0.5 install: `node ./build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the fibers#1.0.5 install script 'node ./build.js'.
npm ERR! This is most likely a problem with the fibers package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./build.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs fibers
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls fibers
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/rocketchat/rchat/programs/server/npm-debug.log
Does it happen because the kernel is too old? It just seems strange that a specific type of virtualization makes nodejs unusable.
Edit: included full npm install output
Edit2: Compiler versions are gcc-4.9, g++-4.9
I figured it out.
First of all, no - the kernel version required by OpenVZ has nothing to do with this.
Here's what happened. The nodeJS app I tried to install (Rocket.Chat) was built with a Meteor framework. Apparently, Meteor only works on NodeJS v0.10.40. Debian 8 repositories only has v4.4.2 and v0.10.29, nodejs website has instructions for v4 and v5.
If you encounter this issue, my advice is to install node v0.10.40 via node version manager. Once it is done, npm install will work as advertised.

Resources