im trying to configure redis on ubuntu to monitoring on nagios from this site https://github.com/mdahiemstra/nagios-check-redis
but when i run $sudo npm install -g nagios-redis im getting this error
npm ERR! ../../nan/nan_implementation_12_inl.h:169:54: error: ‘FTH’ is not a member of ‘NanIntern::Factory<v8::Signature>’
npm ERR! 169 | Factory<v8::Signature>::New( Factory<v8::Signature>::FTH receiver
npm ERR! | ^~~
npm ERR! ../../nan/nan_implementation_12_inl.h:170:30: error: expected primary-expression before ‘int’
npm ERR! 170 | , int argc
npm ERR! | ^~~
npm ERR! ../../nan/nan_implementation_12_inl.h:171:54: error: ‘FTH’ is not a member of ‘NanIntern::Factory<v8::Signature>’
npm ERR! 171 | , Factory<v8::Signature>::FTH argv[]) {
npm ERR! | ^~~
npm ERR! ../../nan/nan_implementation_12_inl.h:171:66: error: expected ‘,’ or ‘;’ before ‘{’ token
npm ERR! 171 | , Factory<v8::Signature>::FTH argv[]) {
npm ERR! | ^
npm ERR! ../../nan/nan_implementation_12_inl.h: In static member function ‘static NanIntern::FactoryBase<v8::String>::return_t NanIntern::Factory<v8::String>::New(const char*, int)’:
npm ERR! ../../nan/nan_implementation_12_inl.h:184:33: warning: ‘static v8::Local<v8::String> v8::String::NewFromUtf8(v8::Isolate*, const char*, v8::String::NewStringType, int)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
npm ERR! 184 | return v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), value,
npm ERR! 534 | , v8::Handle<v8::ObjectTemplate> tmpl = v8::Handle<v8::ObjectTemplate>()
npm ERR! | ^~~~~~~~~~
npm ERR! gyp ERR! System Linux 5.15.0-1008-aws
npm ERR! gyp ERR! command "/usr/bin/node" "/usr/share/nodejs/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /usr/local/lib/node_modules/nagios-redis/node_modules/hiredis
npm ERR! gyp ERR! node -v v12.22.9
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok
i have installed nodejs and npm in ubuntu
Related
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```
I updated a firebase function to node 16 and I'm getting the following deploy error:
Build failed: ...ve_cv_t' is not a member of 'std'
npm ERR! !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
npm ERR! ^~~~~~~~~~~
npm ERR! /www-data-home/.cache/node-gyp/16.18.1/include/node/v8-internal.h:492:38: note: suggested alternative: 'remove_cv'
npm ERR! !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
npm ERR! ^~~~~~~~~~~
npm ERR! remove_cv
npm ERR! /www-data-home/.cache/node-gyp/16.18.1/include/node/v8-internal.h:492:38: error: 'remove_cv_t' is not a member of 'std'
npm ERR! /www-data-home/.cache/node-gyp/16.18.1/include/node/v8-internal.h:492:38: note: suggested alternative: 'remove_cv'
npm ERR! !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
npm ERR! ^~~~~~~~~~~
npm ERR! remove_cv
npm ERR! /www-data-home/.cache/node-gyp/16.18.1/include/node/v8-internal.h:492:50: error: template argument 2 is invalid
npm ERR! !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
npm ERR! ^
npm ERR! /www-data-home/.cache/node-gyp/16.18.1/include/node/v8-internal.h:492:63: error: '::Perform' has not been declared
npm ERR! !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
npm ERR! ^~~~~~~
npm ERR! /www-data-home/.cache/node-gyp/16.18.1/include/node/v8-internal.h:492:63: note: suggested alternative: 'perror'
npm ERR! !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
npm ERR! ^~~~~~~
npm ERR! perror
npm ERR! At global scope:
npm ERR! cc1plus: warning: unrecognized command line option '-Wno-cast-function-type'
npm ERR! make: *** [Release/obj.target/sharp/src/common.o] Error 1
I have already tried removing the cloud function and retrying deploy.
I updated firebase-admin, firebase-functions and #google-cloud/storage packages. I can run the function fine from the shell.
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
I am getting node-gyp error while doing npm install.
It's mainly happening when a project has node-sass or env-cmd these kind of dependencies. While trying to install env-cmd package or node-sass it's getting this errors.
I am using macos bigsur v11.6.1. node version v16.14.0.
Can anybody help ?
npm ERR! ../src/libsass/src/ast.hpp:1616:14: note: use reference type 'const
std::string &' to prevent copying
npm ERR! for (const auto denominator : denominators)
npm ERR! ^~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! &
npm ERR! 2 warnings generated.
npm ERR! In file included from ../src/libsass/src/util.cpp:3:
npm ERR! ../src/libsass/src/ast.hpp:1614:25: warning: loop variable 'numerator' creates a copy from type 'const std::string' [-Wrange-loop-construct]
npm ERR! for (const auto numerator : numerators)
npm ERR! ^
npm ERR! ../src/libsass/src/ast.hpp:1614:14: note: use reference type 'const std::string &' to prevent copying
npm ERR! for (const auto numerator : numerators)
npm ERR! ^~~~~~~~~~~~~~~~~~~~~~
npm ERR! &
npm ERR! ../src/libsass/src/ast.hpp:1616:25: warning: loop variable 'denominator' creates a copy from type 'const std::string' [-Wrange-loop-construct]
npm ERR! for (const auto denominator : denominators)
npm ERR! ^
npm ERR! ../src/libsass/src/ast.hpp:1616:14: note: use reference type 'const std::string &' to prevent copying
npm ERR! for (const auto denominator : denominators)
npm ERR! ^~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! &
npm ERR! 2 warnings generated.
npm ERR! In file included from ../src/libsass/src/values.cpp:3:
npm ERR! In file included from ../src/libsass/src/values.hpp:4:
npm ERR! ../src/libsass/src/ast.hpp:1614:25: warning: loop variable 'numerator' creates a copy from type 'const std::string' [-Wrange-loop-construct]
npm ERR! for (const auto numerator : numerators)
npm ERR! ^
npm ERR! ../src/libsass/src/ast.hpp:1614:14: note: use reference type 'const std::string &' to prevent copying
npm ERR! for (const auto numerator : numerators)
npm ERR! ^~~~~~~~~~~~~~~~~~~~~~
npm ERR! &
npm ERR! ../src/libsass/src/ast.hpp:1616:25: warning: loop variable 'denominator' creates a copy from type 'const std::string' [-Wrange-loop-construct]
npm ERR! for (const auto denominator : denominators)
npm ERR! ^
npm ERR! ../src/libsass/src/ast.hpp:1616:14: note: use reference type 'const std::string &' to prevent copying
npm ERR! for (const auto denominator : denominators)
npm ERR! ^~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! &
npm ERR! 2 warnings generated.
npm ERR! In file included from ../src/binding.cpp:1:
npm ERR! In file included from ../../nan/nan.h:58:
npm ERR! In file included from /Users/macbookpro/.node-gyp/16.14.0/include/node/node.h:63:
npm ERR! In file included from /Users/macbookpro/.node-gyp/16.14.0/include/node/v8.h:30:
npm ERR! /Users/macbookpro/.node-gyp/16.14.0/include/node/v8-internal.h:492:38: error: no template named 'remove_cv_t' in namespace 'std'; did you mean 'remove_cv'?
npm ERR! !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
npm ERR! ~~~~~^~~~~~~~~~~
npm ERR! remove_cv
npm ERR! /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:710:50: note: 'remove_cv' declared here
npm ERR! template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_cv
npm ERR! ^
npm ERR! 1 error generated.
npm ERR! make: *** [Release/obj.target/binding/src/binding.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 (/Users/macbookpro/Desktop/V2 projects/ecrm/latest/ecrm-training-frontend/node_modules/node-gyp/lib/build.js:262:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:520:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Darwin 20.6.0
npm ERR! gyp ERR! command "/usr/local/bin/node" "/Users/macbookpro/Desktop/V2 projects/ecrm/latest/ecrm-training-frontend/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd /Users/macbookpro/Desktop/V2 projects/ecrm/latest/ecrm-training-frontend/node_modules/node-sass
npm ERR! gyp ERR! node -v v16.14.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1
From the comment by #alex-scott you can see many details.
What solved it for me was manual download:
https://github.com/nodejs/node-gyp/blob/HEAD/macOS_Catalina.md#installing-node-gyp-using-the-xcode-command-line-tools-via-manual-download
I downloaded the most recent version that does not require Monterey.
Command_Line_Tools_for_Xcode_13.2.dmg
xcode-select --install did NOT install the correct version.
I solve this error, I only need to use the command
yarn add node-sass
This update the node-sass and solve all the errors inside the packages when we try to install everything
EDIT:
Node-sass is already deprecated, you should check Sass instead
I'm having trouble installing the front-end of my web app I'm trying to deploy on a VPS. It's running Ubuntu 21.04, the back-end npm installs successfully but I'm unable to npm install the front-end correctly. Attached is the log.
Within the body of the post contains a shortened version of the log, I tried to include all the pertinent info but I'm not exactly sure what I'm looking at here. The full logs are linked on the gist below. Any help would be greatly appreciated!
https://gist.github.com/jermerc/d868fc518d1c5ff613247487a3b94d16
npm verb stack Error: command failed
npm ERR! gyp verb cli [
npm ERR! gyp verb cli '/usr/bin/node',
npm ERR! gyp verb cli '/root/ticketkings/frontend/node_modules/node-gyp/bin/node-gyp.js',
npm ERR! gyp verb cli 'rebuild',
npm ERR! gyp verb cli '--verbose',
npm ERR! gyp verb cli '--libsass_ext=',
npm ERR! gyp verb cli '--libsass_cflags=',
npm ERR! gyp verb cli '--libsass_ldflags=',
npm ERR! gyp verb cli '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp#3.8.0
npm ERR! gyp info using node#16.3.0 | linux | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb check python checking for Python executable "python2" in the PATH
npm ERR! gyp verb `which` succeeded python2 /usr/bin/python2
npm ERR! gyp verb check python version `/usr/bin/python2 -c "import sys; print "2.7.18
npm ERR! gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j
npm ERR! gyp verb get node dir no --target version specified, falling back to host node version: 16.3.0
npm ERR! gyp verb command install [ '16.3.0' ]
npm ERR! gyp verb install input version string "16.3.0"
npm ERR! gyp verb install installing version: 16.3.0
npm ERR! gyp verb install --ensure was passed, so won't reinstall if already installed
npm ERR! gyp verb install version is already installed, need to check "installVersion"
npm ERR! gyp verb got "installVersion" 9
npm ERR! gyp verb needs "installVersion" 9
npm ERR! gyp verb install version is good
npm ERR! gyp verb get node dir target node version installed: 16.3.0
npm ERR! gyp verb build dir attempting to create "build" dir: /root/ticketkings/frontend/node_modules/node-sass/build
npm ERR! gyp verb build dir "build" dir needed to be created? /root/ticketkings/frontend/node_modules/node-sass/build
npm ERR! gyp verb build/config.gypi creating config file
npm ERR! gyp verb build/config.gypi writing out config file: /root/ticketkings/frontend/node_modules/node-sass/build/config.gypi
npm ERR! (node:1360) [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 verb config.gypi checking for gypi file: /root/ticketkings/frontend/node_modules/node-sass/config.gypi
npm ERR! gyp verb common.gypi checking for gypi file: /root/ticketkings/frontend/node_modules/node-sass/common.gypi
npm ERR! gyp verb gyp gyp format was not specified; forcing "make"
npm ERR! gyp info spawn /usr/bin/python2
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/root/ticketkings/frontend/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 '/root/ticketkings/frontend/node_modules/node-sass/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/root/ticketkings/frontend/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/root/.node-gyp/16.3.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/.node-gyp/16.3.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/root/ticketkings/frontend/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/root/.node-gyp/16.3.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/root/ticketkings/frontend/node_modules/node-sass',
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 verb command build []
npm ERR! gyp verb build type Release
npm ERR! gyp verb architecture x64
npm ERR! gyp verb node dev dir /root/.node-gyp/16.3.0
npm ERR! gyp verb `which` succeeded for `make` /usr/bin/make
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! ../src/libsass/src/cencode.c: In function ‘base64_encode_block’:
npm ERR! ../src/libsass/src/cencode.c:48:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
npm ERR! 48 | result = (fragment & 0x003) << 4;
npm ERR! | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! ../src/libsass/src/cencode.c:52:2: note: here
npm ERR! 52 | case step_B:
npm ERR! | ^~~~
npm ERR! ../src/libsass/src/cencode.c:62:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
npm ERR! 62 | result = (fragment & 0x00f) << 2;
npm ERR! | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! ../src/libsass/src/cencode.c:66:2: note: here
npm ERR! 66 | case step_C:
npm ERR! | ^~~~
npm ERR! ../src/libsass/src/functions.cpp: In function ‘void Sass::Functions::handle_utf8_error(const Sass::ParserState&, Sass::Backtraces)’:
npm ERR! ../src/libsass/src/functions.cpp:110:20: warning: catching polymorphic type ‘class utf8::invalid_code_point’ by value [-Wcatch-value=]
npm ERR! 110 | catch (utf8::invalid_code_point) {
npm ERR! | ^~~~~~~~~~~~~~~~~~
npm ERR! ../src/libsass/src/functions.cpp:114:20: warning: catching polymorphic type ‘class utf8::not_enough_room’ by value [-Wcatch-value=]
npm ERR! 114 | catch (utf8::not_enough_room) {
npm ERR! | ^~~~~~~~~~~~~~~
npm ERR! ../src/libsass/src/functions.cpp:118:20: warning: catching polymorphic type ‘class utf8::invalid_utf8’ by value [-Wcatch-value=]
npm ERR! 118 | catch (utf8::invalid_utf8) {
npm ERR! | ^~~~~~~~~~~~
npm ERR! ../src/libsass/src/json.cpp: In function ‘char* json_encode_string(const char*)’:
npm ERR! ../src/libsass/src/json.cpp:405:15: warning: catching polymorphic type ‘class std::exception’ by value [-Wcatch-value=]
npm ERR! 405 | catch (std::exception) {
npm ERR! | ^~~~~~~~~
npm ERR! ../src/libsass/src/json.cpp: In function ‘char* json_stringify(const JsonNode*, const char*)’:
npm ERR! ../src/libsass/src/json.cpp:424:15: warning: catching polymorphic type ‘class std::exception’ by value [-Wcatch-value=]
npm ERR! 424 | catch (std::exception) {
npm ERR! | ^~~~~~~~~
npm ERR! In file included from /root/.node-gyp/16.3.0/include/node/v8.h:30,
npm ERR! from /root/.node-gyp/16.3.0/include/node/node.h:63,
npm ERR! from ../../nan/nan.h:56,
npm ERR! from ../src/binding.cpp:1:
npm ERR! /root/.node-gyp/16.3.0/include/node/v8-internal.h: In function ‘void v8::internal::PerformCastCheck(T*)’:
npm ERR! /root/.node-gyp/16.3.0/include/node/v8-internal.h:452:38: error: ‘remove_cv_t’ is not a member of ‘std’; did you mean ‘remove_cv’?
npm ERR! 452 | !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
npm ERR! | ^~~~~~~~~~~
npm ERR! | remove_cv
npm ERR! /root/.node-gyp/16.3.0/include/node/v8-internal.h:452:38: error: ‘remove_cv_t’ is not a member of ‘std’; did you mean ‘remove_cv’?
npm ERR! 452 | !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
npm ERR! | ^~~~~~~~~~~
npm ERR! | remove_cv
npm ERR! /root/.node-gyp/16.3.0/include/node/v8-internal.h:452:50: error: template argument 2 is invalid
npm ERR! 452 | !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
npm ERR! | ^
npm ERR! /root/.node-gyp/16.3.0/include/node/v8-internal.h:452:63: error: ‘::Perform’ has not been declared
npm ERR! 452 | !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
npm ERR! | ^~~~~~~
npm ERR! In file included from ../src/binding.cpp:1:
npm ERR! ../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
npm ERR! ../../nan/nan.h:2294:7: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
npm ERR! 2294 | , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
npm ERR! | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! ../src/binding.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE render(Nan::NAN_METHOD_ARGS_TYPE)’:
npm ERR! ../src/binding.cpp:284:80: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
npm ERR! 284 | int status = uv_queue_work(uv_default_loop(), &ctx_w->request, compile_it, (uv_after_work_cb)MakeCallback);
npm ERR! | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! ../src/binding.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE render_file(Nan::NAN_METHOD_ARGS_TYPE)’:
npm ERR! ../src/binding.cpp:320:80: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
npm ERR! 320 | int status = uv_queue_work(uv_default_loop(), &ctx_w->request, compile_it, (uv_after_work_cb)MakeCallback);
npm ERR! | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! In file included from ../../nan/nan.h:56,
npm ERR! from ../src/binding.cpp:1:
npm ERR! ../src/binding.cpp: At global scope:
npm ERR! /root/.node-gyp/16.3.0/include/node/node.h:806:7: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void (*)(v8::Local<v8::Object>)’} to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
npm ERR! 806 | (node::addon_register_func) (regfunc), \
npm ERR! | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! /root/.node-gyp/16.3.0/include/node/node.h:840:3: note: in expansion of macro ‘NODE_MODULE_X’
npm ERR! 840 | NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage)
npm ERR! | ^~~~~~~~~~~~~
npm ERR! ../src/binding.cpp:358:1: note: in expansion of macro ‘NODE_MODULE’
npm ERR! 358 | NODE_MODULE(binding, RegisterModule);
npm ERR! | ^~~~~~~~~~~
npm ERR! make: *** [binding.target.mk:133: Release/obj.target/binding/src/binding.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 (/root/ticketkings/frontend/node_modules/node-gyp/lib/build.js:262:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:394:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Linux 5.11.0-18-generic
npm ERR! gyp ERR! command "/usr/bin/node" "/root/ticketkings/frontend/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd /root/ticketkings/frontend/node_modules/node-sass
npm ERR! gyp ERR! node -v v16.3.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1
npm verb exit 1
npm timing npm Completed in 540608ms
npm verb code 1
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-06-09T14_51_55_048Z-debug.log```
I had the same problem with node 16.
I had to use node 12 in order to build correctly.
Either change your version with nvm or if you use docker choose this image : node:12.20.2.