Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to install node-gyp with node 14/16 #2458

Closed
rupeshpadhye opened this issue Jul 21, 2021 · 10 comments
Closed

Failed to install node-gyp with node 14/16 #2458

rupeshpadhye opened this issue Jul 21, 2021 · 10 comments
Labels

Comments

@rupeshpadhye
Copy link

rupeshpadhye commented Jul 21, 2021

  • Node Version: v16.5.0 or v 14
  • Platform: Mac OS
  • Compiler:
  • Module: npm install
Verbose output (from npm or node-gyp):
15598 verbose node v16.5.0
15599 verbose npm  v7.19.1
15600 error code 1
15601 error path <path>/usage
15602 error command failed
15603 error command sh -c node-gyp rebuild
15604 error CXX(target) Release/obj.target/sysinfo/src/binding.o
15605 error gyp info it worked if it ends with ok
15605 error gyp info using node-gyp@7.1.2
15605 error gyp info using node@16.5.0 | darwin | x64
15605 error gyp info find Python using Python version 3.8.2 found at "/Applications/Xcode.app/Contents/Developer/usr/bin/python3"
15605 error (node:45062) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
15605 error (Use `node --trace-deprecation ...` to show where the warning was created)
15605 error gyp info spawn /Applications/Xcode.app/Contents/Developer/usr/bin/python3
15605 error gyp info spawn args [
15605 error gyp info spawn args   '/Users/<name>/.nvm/versions/node/v16.5.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
15605 error gyp info spawn args   'binding.gyp',
15605 error gyp info spawn args   '-f',
15605 error gyp info spawn args   'make',
15605 error gyp info spawn args   '-I',
15605 error gyp info spawn args   '<path>/node_modules/usage/build/config.gypi',
15605 error gyp info spawn args   '-I',
15605 error gyp info spawn args   '/Users/rupesh/.nvm/versions/node/v16.5.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
15605 error gyp info spawn args   '-I',
15605 error gyp info spawn args   '/<path>/Library/Caches/node-gyp/16.5.0/include/node/common.gypi',
15605 error gyp info spawn args   '-Dlibrary=shared_library',
15605 error gyp info spawn args   '-Dvisibility=default',
15605 error gyp info spawn args   '-Dnode_root_dir=/Users/rupesh/Library/Caches/node-gyp/16.5.0',
15605 error gyp info spawn args   '-Dnode_gyp_dir=/<path>.nvm/versions/node/v16.5.0/lib/node_modules/npm/node_modules/node-gyp',
15605 error gyp info spawn args   '-Dnode_lib_file=/Users/rupesh/Library/Caches/node-gyp/16.5.0/<(target_arch)/node.lib',
15605 error gyp info spawn args   '-Dmodule_root_dir=/Users/rupesh/code/<dir>/node_modules/usage',
15605 error gyp info spawn args   '-Dnode_engine=v8',
15605 error gyp info spawn args   '--depth=.',
15605 error gyp info spawn args   '--no-parallel',
15605 error gyp info spawn args   '--generator-output',
15605 error gyp info spawn args   'build',
15605 error gyp info spawn args   '-Goutput_dir=.'
15605 error gyp info spawn args ]
15605 error gyp info spawn make
15605 error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
15605 error ../src/binding.cpp:16:12: error: no matching member function for call to 'Set'
15605 error   exports->Set(Nan::New<String>("OS").ToLocalChecked(), Nan::New<String>(OS).ToLocalChecked());
15605 error   ~~~~~~~~~^~~
15605 error /Users/<name>/Library/Caches/node-gyp/16.5.0/include/node/v8.h:3945:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
15605 error   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
15605 error                                     ^
15605 error /Users/<path>/Library/Caches/node-gyp/16.5.0/include/node/v8.h:3948:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
15605 error   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
15605 error                                     ^
15605 error 1 error generated.
15605 error make: *** [Release/obj.target/sysinfo/src/binding.o] Error 1
15605 error gyp ERR! build error
15605 error gyp ERR! stack Error: `make` failed with exit code: 2

Not able to install node-gyp, if I am downgrading node to 12 it's working

Update 1 - on (22/07/21)

context - Currently using node 10.x in the project, updating the dependencies as 10 is EOL

Steps did so far -

  • Removed the node_modules and lock files
  • updated yarn global upgrade
  • updated engines in package.json from 10.x to 14/16 and npm as well
  • tried with npm install in the project directory
@cclauss
Copy link
Contributor

cclauss commented Jul 21, 2021

What command was typed to get this output?

@rupeshpadhye
Copy link
Author

@cclauss updated the issue , let me if you need more inputs

@levin-ilya
Copy link

I also hit the same issue, switch to node 12 and it worked ok.

1 warning and 1 error generated.
make[1]: *** [Release/obj.target/binding/src/binding.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/work/Developer/sbx/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (node:events:394:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
gyp ERR! System Darwin 20.4.0
gyp ERR! command "/usr/local/Cellar/node/16.7.0/bin/node" "/Users/work/Developer/sbx/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/work/Developer/sbx/node_modules/node-sass
gyp ERR! node -v v16.7.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

@cclauss
Copy link
Contributor

cclauss commented Aug 18, 2021

Please!

gyp ERR! node-gyp -v v3.8.0

Does not align with https://github.com/nodejs/node-gyp/releases

@MaLIE2018
Copy link

For me it solved to install node with x86 on Mac.
nvm-sh/nvm#2350 (comment)

@cclauss cclauss added the macOS label Jan 4, 2022
@cclauss cclauss closed this as completed Jan 4, 2022
@RobQuistNL
Copy link

Please!

gyp ERR! node-gyp -v v3.8.0

Does not align with https://github.com/nodejs/node-gyp/releases

Running this did not help;

8966 error gyp ERR! build error 
8966 error gyp ERR! stack Error: `make` failed with exit code: 2
8966 error gyp ERR! stack     at ChildProcess.onExit (/home/project/node_modules/node-gyp/lib/build.js:262:23)
8966 error gyp ERR! stack     at ChildProcess.emit (node:events:520:28)
8966 error gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
8966 error gyp ERR! System Linux 5.13.0-28-generic
8966 error gyp ERR! command "/usr/bin/node" "/home/project/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
8966 error gyp ERR! cwd /home/project/node_modules/node-sass
8966 error gyp ERR! node -v v16.14.0
8966 error gyp ERR! node-gyp -v v3.8.0
8966 error gyp ERR! not ok 
8966 error Build failed with error code: 1
8967 verbose exit 1

$ node -v
v16.14.0
$ npm -v
8.5.1
$ node-gyp -v
v8.4.1

@cclauss
Copy link
Contributor

cclauss commented Feb 22, 2022

Is there clutter in your package.json file?

@RobQuistNL
Copy link

Probably, I've since removed all the version contraints for node-sass and related packages, and re-added them using the npm install --save-dev command - this seems to have resolved them to proper versions.
Thanks for the quick reply!

@mohd-sher-khan
Copy link

any one fins the best solution for this problem. i am also facing this problem

@cclauss
Copy link
Contributor

cclauss commented May 6, 2022

@mohd-sher-khan Please open a new issue with the command you typed and the full error log.

@nodejs nodejs locked as resolved and limited conversation to collaborators May 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants