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

Error in evaluating "build_v8_with_gn" on node-gyp v3.4.0 for Node target v10.x #1457

Closed
kanikashah90 opened this issue Jun 7, 2018 · 2 comments

Comments

@kanikashah90
Copy link

  • Node Version: v6.12.3
  • Npm Version:3.10.10
  • Platform: Darwin {machineName} 17.3.0 Darwin Kernel Version 17.3.0: Thu Nov 9 18:09:22 PST 2017; root:xnu-4570.31.3~1/RELEASE_X86_64 x86_64
  • Compiler:
    Apple LLVM version 8.1.0 (clang-802.0.42)
    Target: x86_64-apple-darwin17.3.0
    Thread model: posix
    InstalledDir: /Applications/Xcode-8.3.3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

I am trying to build a native module on Node version 6.12.3 with target set to Node version 10.x. But the node-gyp command error out message:
gyp: name 'build_v8_with_gn' is not defined while evaluating condition 'build_v8_with_gn == "true"' in binding.gyp while trying to load binding.gyp

Here are the commands I am invoking:

node --version
v6.12.3

~/{nodeSourceCodeLocation}/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js --version
v3.4.0

~/{nodeSourceCodeLocation}/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --target=v10.4.0 --release

gyp info it worked if it ends with ok
gyp verb cli [ '{nodeSourceCodeLocation}/bin/node',
gyp verb cli   '{nodeSourceCodeLocation}/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--target=v10.4.0',
gyp verb cli   '--release']
gyp info using node-gyp@3.4.0
gyp info using node@6.12.3 | darwin | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` succeeded python2 /usr/local/bin/python2
gyp verb check python version `/usr/local/bin/python2 -c "import platform; print(platform.python_version());"` returned: "2.7.15\n"
gyp verb get node dir compiling against --target node version: 10.4.0
gyp verb command install [ '10.4.0' ]
gyp verb install input version string "10.4.0"
gyp verb install installing version: 10.4.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 10.4.0
gyp verb build dir attempting to create "build" dir: {sourceFolderOnMyLocalMachine}/build
gyp verb build dir "build" dir needed to be created? {sourceFolderOnMyLocalMachine}/build
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: {sourceFolderOnMyLocalMachine}/build/config.gypi
gyp verb config.gypi checking for gypi file: {sourceFolderOnMyLocalMachine}/buildconfig.gypi
gyp verb common.gypi checking for gypi file: {sourceFolderOnMyLocalMachine}/common.gypi
gyp verb gyp gyp format was not specified; forcing "make"
gyp info spawn /usr/local/bin/python2
gyp info spawn args [ '{nodeSourceCodeLocation}/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '{buildTargetLocaltionOnMyLocalMachine}/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '{nodeSourceCodeLocation}/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '{$HOME}/.node-gyp/10.4.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir={$HOME}/.node-gyp/10.4.0',
gyp info spawn args   '-Dnode_gyp_dir={nodeSourceCodeLocation}/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=node.lib',
gyp info spawn args   '-Dmodule_root_dir={sourceFolderOnMyLocalMachine}',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
**gyp: name 'build_v8_with_gn' is not defined while evaluating condition 'build_v8_with_gn == "true"' in binding.gyp while trying to load binding.gyp**
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit ({nodeSourceCodeLocation}/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:305:16)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:219:12)
gyp ERR! System Darwin 17.3.0
gyp ERR! command "{nodeSourceCodeLocation}/bin/node" "{nodeSourceCodeLocation}/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--target=v10.4.0" "--release"
gyp ERR! cwd {sourceFolderOnMyLocalMachine}
gyp ERR! node -v v6.12.3
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok 

The same issue is seen here prebuild/prebuildify#10 and there are insights on how to reproduce it.

@bnoordhuis
Copy link
Member

build_v8_with_gn is coming from Node.js v10's common.gypi. As a workaround you can pass --build_v8_with_gn=false to node-gyp or npm.

Does it also happen with node-gyp 3.6.0?

@kanikashah90
Copy link
Author

The workaround worked. Thanks :)

Yeah, it also happens with node-gyp 3.6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants