{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/node-gyp/issues/1457","repository_url":"https://api.github.com/repos/nodejs/node-gyp","labels_url":"https://api.github.com/repos/nodejs/node-gyp/issues/1457/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node-gyp/issues/1457/comments","events_url":"https://api.github.com/repos/nodejs/node-gyp/issues/1457/events","html_url":"https://github.com/nodejs/node-gyp/issues/1457","id":330350843,"node_id":"MDU6SXNzdWUzMzAzNTA4NDM=","number":1457,"title":"Error in evaluating \"build_v8_with_gn\" on node-gyp v3.4.0 for Node target v10.x","user":{"login":"kanikashah90","id":2753761,"node_id":"MDQ6VXNlcjI3NTM3NjE=","avatar_url":"https://avatars0.githubusercontent.com/u/2753761?v=4","gravatar_id":"","url":"https://api.github.com/users/kanikashah90","html_url":"https://github.com/kanikashah90","followers_url":"https://api.github.com/users/kanikashah90/followers","following_url":"https://api.github.com/users/kanikashah90/following{/other_user}","gists_url":"https://api.github.com/users/kanikashah90/gists{/gist_id}","starred_url":"https://api.github.com/users/kanikashah90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kanikashah90/subscriptions","organizations_url":"https://api.github.com/users/kanikashah90/orgs","repos_url":"https://api.github.com/users/kanikashah90/repos","events_url":"https://api.github.com/users/kanikashah90/events{/privacy}","received_events_url":"https://api.github.com/users/kanikashah90/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-07T16:37:40Z","updated_at":"2018-06-07T17:54:56Z","closed_at":null,"author_association":"NONE","body":"* **Node Version**: v6.12.3\r\n* **Npm Version**:3.10.10\r\n* **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\r\n* **Compiler**: \r\nApple LLVM version 8.1.0 (clang-802.0.42)\r\nTarget: x86_64-apple-darwin17.3.0\r\nThread model: posix\r\nInstalledDir: /Applications/Xcode-8.3.3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin\r\n\r\nI 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:\r\n`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`\r\n\r\nHere are the commands I am invoking:\r\n```\r\nnode --version\r\nv6.12.3\r\n\r\n~/{nodeSourceCodeLocation}/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js --version\r\nv3.4.0\r\n\r\n~/{nodeSourceCodeLocation}/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --target=v10.4.0 --release\r\n\r\ngyp info it worked if it ends with ok\r\ngyp verb cli [ '{nodeSourceCodeLocation}/bin/node',\r\ngyp verb cli   '{nodeSourceCodeLocation}/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js',\r\ngyp verb cli   'rebuild',\r\ngyp verb cli   '--verbose',\r\ngyp verb cli   '--target=v10.4.0',\r\ngyp verb cli   '--release']\r\ngyp info using node-gyp@3.4.0\r\ngyp info using node@6.12.3 | darwin | x64\r\ngyp verb command rebuild []\r\ngyp verb command clean []\r\ngyp verb clean removing \"build\" directory\r\ngyp verb command configure []\r\ngyp verb check python checking for Python executable \"python2\" in the PATH\r\ngyp verb `which` succeeded python2 /usr/local/bin/python2\r\ngyp verb check python version `/usr/local/bin/python2 -c \"import platform; print(platform.python_version());\"` returned: \"2.7.15\\n\"\r\ngyp verb get node dir compiling against --target node version: 10.4.0\r\ngyp verb command install [ '10.4.0' ]\r\ngyp verb install input version string \"10.4.0\"\r\ngyp verb install installing version: 10.4.0\r\ngyp verb install --ensure was passed, so won't reinstall if already installed\r\ngyp verb install version is already installed, need to check \"installVersion\"\r\ngyp verb got \"installVersion\" 9\r\ngyp verb needs \"installVersion\" 9\r\ngyp verb install version is good\r\ngyp verb get node dir target node version installed: 10.4.0\r\ngyp verb build dir attempting to create \"build\" dir: {sourceFolderOnMyLocalMachine}/build\r\ngyp verb build dir \"build\" dir needed to be created? {sourceFolderOnMyLocalMachine}/build\r\ngyp verb build/config.gypi creating config file\r\ngyp verb build/config.gypi writing out config file: {sourceFolderOnMyLocalMachine}/build/config.gypi\r\ngyp verb config.gypi checking for gypi file: {sourceFolderOnMyLocalMachine}/buildconfig.gypi\r\ngyp verb common.gypi checking for gypi file: {sourceFolderOnMyLocalMachine}/common.gypi\r\ngyp verb gyp gyp format was not specified; forcing \"make\"\r\ngyp info spawn /usr/local/bin/python2\r\ngyp info spawn args [ '{nodeSourceCodeLocation}/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',\r\ngyp info spawn args   'binding.gyp',\r\ngyp info spawn args   '-f',\r\ngyp info spawn args   'make',\r\ngyp info spawn args   '-I',\r\ngyp info spawn args   '{buildTargetLocaltionOnMyLocalMachine}/config.gypi',\r\ngyp info spawn args   '-I',\r\ngyp info spawn args   '{nodeSourceCodeLocation}/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',\r\ngyp info spawn args   '-I',\r\ngyp info spawn args   '{$HOME}/.node-gyp/10.4.0/include/node/common.gypi',\r\ngyp info spawn args   '-Dlibrary=shared_library',\r\ngyp info spawn args   '-Dvisibility=default',\r\ngyp info spawn args   '-Dnode_root_dir={$HOME}/.node-gyp/10.4.0',\r\ngyp info spawn args   '-Dnode_gyp_dir={nodeSourceCodeLocation}/lib/node_modules/npm/node_modules/node-gyp',\r\ngyp info spawn args   '-Dnode_lib_file=node.lib',\r\ngyp info spawn args   '-Dmodule_root_dir={sourceFolderOnMyLocalMachine}',\r\ngyp info spawn args   '--depth=.',\r\ngyp info spawn args   '--no-parallel',\r\ngyp info spawn args   '--generator-output',\r\ngyp info spawn args   'build',\r\ngyp info spawn args   '-Goutput_dir=.' ]\r\n**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**\r\ngyp ERR! configure error \r\ngyp ERR! stack Error: `gyp` failed with exit code: 1\r\ngyp ERR! stack     at ChildProcess.onCpExit ({nodeSourceCodeLocation}/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:305:16)\r\ngyp ERR! stack     at emitTwo (events.js:106:13)\r\ngyp ERR! stack     at ChildProcess.emit (events.js:191:7)\r\ngyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:219:12)\r\ngyp ERR! System Darwin 17.3.0\r\ngyp 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\"\r\ngyp ERR! cwd {sourceFolderOnMyLocalMachine}\r\ngyp ERR! node -v v6.12.3\r\ngyp ERR! node-gyp -v v3.4.0\r\ngyp ERR! not ok \r\n\r\n```\r\nThe same issue is seen here https://github.com/mafintosh/prebuildify/issues/10 and there are insights on how to reproduce it.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/nodejs/node-gyp/issues/comments/395509557","html_url":"https://github.com/nodejs/node-gyp/issues/1457#issuecomment-395509557","issue_url":"https://api.github.com/repos/nodejs/node-gyp/issues/1457","id":395509557,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NTUwOTU1Nw==","user":{"login":"kanikashah90","id":2753761,"node_id":"MDQ6VXNlcjI3NTM3NjE=","avatar_url":"https://avatars0.githubusercontent.com/u/2753761?v=4","gravatar_id":"","url":"https://api.github.com/users/kanikashah90","html_url":"https://github.com/kanikashah90","followers_url":"https://api.github.com/users/kanikashah90/followers","following_url":"https://api.github.com/users/kanikashah90/following{/other_user}","gists_url":"https://api.github.com/users/kanikashah90/gists{/gist_id}","starred_url":"https://api.github.com/users/kanikashah90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kanikashah90/subscriptions","organizations_url":"https://api.github.com/users/kanikashah90/orgs","repos_url":"https://api.github.com/users/kanikashah90/repos","events_url":"https://api.github.com/users/kanikashah90/events{/privacy}","received_events_url":"https://api.github.com/users/kanikashah90/received_events","type":"User","site_admin":false},"created_at":"2018-06-07T17:54:56Z","updated_at":"2018-06-07T17:54:56Z","author_association":"NONE","body":"The workaround worked. Thanks :)\r\n\r\nYeah, it also happens with node-gyp 3.6.0"}}
{"actor":{"display_login":"kanikashah90"}}