{"action":"created","issue":{"url":"https://api.github.com/repos/electron/electron-rebuild/issues/221","repository_url":"https://api.github.com/repos/electron/electron-rebuild","labels_url":"https://api.github.com/repos/electron/electron-rebuild/issues/221/labels{/name}","comments_url":"https://api.github.com/repos/electron/electron-rebuild/issues/221/comments","events_url":"https://api.github.com/repos/electron/electron-rebuild/issues/221/events","html_url":"https://github.com/electron/electron-rebuild/issues/221","id":291026159,"number":221,"title":"Flag set by `npm config set msvs_version 2015 --global`  is not being honored by electron-rebuild","user":{"login":"corvinrok","id":5266827,"avatar_url":"https://avatars1.githubusercontent.com/u/5266827?v=4","gravatar_id":"","url":"https://api.github.com/users/corvinrok","html_url":"https://github.com/corvinrok","followers_url":"https://api.github.com/users/corvinrok/followers","following_url":"https://api.github.com/users/corvinrok/following{/other_user}","gists_url":"https://api.github.com/users/corvinrok/gists{/gist_id}","starred_url":"https://api.github.com/users/corvinrok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corvinrok/subscriptions","organizations_url":"https://api.github.com/users/corvinrok/orgs","repos_url":"https://api.github.com/users/corvinrok/repos","events_url":"https://api.github.com/users/corvinrok/events{/privacy}","received_events_url":"https://api.github.com/users/corvinrok/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-01-23T23:05:37Z","updated_at":"2018-02-25T17:25:56Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"## Issue:\r\n I originally had a problem building my application after upgrading from VS 2013 to VS 2015, but that problem was solved by setting `msvs_version 2015`. While that worked for the `npm install` (and its node compiles), it somehow is being ignored at the `electron-rebuild` stage.\r\n\r\n## Details:\r\n\r\n### Initial issue\r\nSpecifically, my build process once had this issue (when I first upgraded):\r\n```\r\n22:07:39 c:\\work-projects\\my-application>c:\\CM\\elevated_cmd.exe /C \"npm install > npm_install.log\"  \r\n22:22:38 \r\n22:22:38 c:\\work-projects\\my-application>type npm_install.log \r\n22:22:38 \r\n22:22:38 > libxmljs-mt@0.16.1 install c:\\work-projects\\my-application\\node_modules\\libxmljs-mt\r\n22:22:38 > node-gyp rebuild\r\n22:22:38 \r\n22:22:38 \r\n22:22:38 c:\\work-projects\\my-application\\node_modules\\libxmljs-mt>if not defined npm_config_node_gyp (node \"C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\node-gyp-bin\\\\..\\..\\node_modules\\node-gyp\\bin\\node-gyp.js\" rebuild )  else (node \"\" rebuild ) \r\n22:22:38 Building the projects in this solution one at a time. To enable parallel build, please add the \"/m\" switch.\r\n22:22:38 C:\\Program Files (x86)\\MSBuild\\Microsoft.Cpp\\v4.0\\V140\\Microsoft.Cpp.Platform.targets(57,5): error MSB8020: The build tools for v120 (Platform Toolset = 'v120') cannot be found. To build using the v120 build tools, please install v120 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting \"Retarget solution\". [c:\\work-projects\\my-application\\node_modules\\libxmljs-mt\\build\\xmljs.vcxproj]\r\n```\r\n\r\n### Initial solution\r\nBut that was quickly remedied by this command setting:\r\n`npm config set msvs_version 2015 --global`\r\n\r\n### Current Issue\r\nOnce I set the command above, things seemed to be working fine. (the initial compiles that happen during `npm install` started working fine). But once I got to the build part that uses `electron-rebuild`, I found the same error returned but only during the electron-rebuild compiles, as follows:\r\n```\r\n13:15:32 c:\\work-projects\\my-application>c:\\CM\\elevated_cmd.exe /C \"gulp erebuild > erebuild.log\"  \r\n13:16:05 \r\n13:16:05 c:\\work-projects\\my-application>type erebuild.log \r\n13:16:05 [13:15:41] Using gulpfile c:\\work-projects\\my-application\\gulpfile.js\r\n13:16:05 [13:15:41] Starting 'erebuild'...\r\n13:16:05 [13:15:41] Finished 'erebuild' after 394 ms\r\n13:16:05 [13:16:04] Rebuilding modules against Electron didn't work: Error: gyp info it worked if it ends with ok\r\n13:16:05 gyp info using node-gyp@3.6.2\r\n13:16:05 gyp info using node@7.10.1 | win32 | x64\r\n13:16:05 gyp http GET https://atom.io/download/electron/v1.8.2-beta.4/iojs-v1.8.2-beta.4.tar.gz\r\n13:16:05 gyp http 200 https://atom.io/download/electron/v1.8.2-beta.4/iojs-v1.8.2-beta.4.tar.gz\r\n13:16:05 gyp http GET https://atom.io/download/electron/v1.8.2-beta.4/SHASUMS256.txt\r\n13:16:05 gyp http GET https://atom.io/download/electron/v1.8.2-beta.4/win-x64/iojs.lib\r\n13:16:05 gyp http GET https://atom.io/download/electron/v1.8.2-beta.4/win-x86/iojs.lib\r\n13:16:05 gyp http 200 https://atom.io/download/electron/v1.8.2-beta.4/win-x64/iojs.lib\r\n13:16:05 gyp http 200 https://atom.io/download/electron/v1.8.2-beta.4/SHASUMS256.txt\r\n13:16:05 gyp http 200 https://atom.io/download/electron/v1.8.2-beta.4/win-x86/iojs.lib\r\n13:16:05 gyp info spawn C:\\Python27\\python.exe\r\n13:16:05 gyp info spawn args [ 'c:\\\\work-projects\\\\my-application\\\\node_modules\\\\node-gyp\\\\gyp\\\\gyp_main.py',\r\n13:16:05 gyp info spawn args   'binding.gyp',\r\n13:16:05 gyp info spawn args   '-f',\r\n13:16:05 gyp info spawn args   'msvs',\r\n13:16:05 gyp info spawn args   '-G',\r\n13:16:05 gyp info spawn args   'msvs_version=auto',\r\n13:16:05 gyp info spawn args   '-I',\r\n13:16:05 gyp info spawn args   'c:\\\\work-projects\\\\my-application\\\\node_modules\\\\libxml-xsd\\\\build\\\\config.gypi',\r\n13:16:05 gyp info spawn args   '-I',\r\n13:16:05 gyp info spawn args   'c:\\\\work-projects\\\\my-application\\\\node_modules\\\\libxml-xsd\\\\common.gypi',\r\n13:16:05 gyp info spawn args   '-I',\r\n13:16:05 gyp info spawn args   'c:\\\\work-projects\\\\my-application\\\\node_modules\\\\node-gyp\\\\addon.gypi',\r\n13:16:05 gyp info spawn args   '-I',\r\n13:16:05 gyp info spawn args   'C:\\\\Users\\\\MyBuilderUser\\\\.electron-gyp\\\\.node-gyp\\\\iojs-1.8.2-beta.4\\\\common.gypi',\r\n13:16:05 gyp info spawn args   '-Dlibrary=shared_library',\r\n13:16:05 gyp info spawn args   '-Dvisibility=default',\r\n13:16:05 gyp info spawn args   '-Dnode_root_dir=C:\\\\Users\\\\MyBuilderUser\\\\.electron-gyp\\\\.node-gyp\\\\iojs-1.8.2-beta.4',\r\n13:16:05 gyp info spawn args   '-Dnode_gyp_dir=c:\\\\work-projects\\\\my-application\\\\node_modules\\\\node-gyp',\r\n13:16:05 gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\MyBuilderUser\\\\.electron-gyp\\\\.node-gyp\\\\iojs-1.8.2-beta.4\\\\<(target_arch)\\\\iojs.lib',\r\n13:16:05 gyp info spawn args   '-Dmodule_root_dir=c:\\\\work-projects\\\\my-application\\\\node_modules\\\\libxml-xsd',\r\n13:16:05 gyp info spawn args   '-Dnode_engine=v8',\r\n13:16:05 gyp info spawn args   '--depth=.',\r\n13:16:05 gyp info spawn args   '--no-parallel',\r\n13:16:05 gyp info spawn args   '--generator-output',\r\n13:16:05 gyp info spawn args   'c:\\\\work-projects\\\\my-application\\\\node_modules\\\\libxml-xsd\\\\build',\r\n13:16:05 gyp info spawn args   '-Goutput_dir=.' ]\r\n13:16:05 gyp info spawn C:\\Program Files (x86)\\MSBuild\\14.0\\bin\\msbuild.exe\r\n13:16:05 gyp info spawn args [ 'build/binding.sln',\r\n13:16:05 gyp info spawn args   '/clp:Verbosity=minimal',\r\n13:16:05 gyp info spawn args   '/nologo',\r\n13:16:05 gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]\r\n13:16:05 Building the projects in this solution one at a time. To enable parallel build, please add the \"/m\" switch.\r\n13:16:05 C:\\Program Files (x86)\\MSBuild\\Microsoft.Cpp\\v4.0\\V140\\Microsoft.Cpp.Platform.targets(57,5): error MSB8020: The build tools for v120 (Platform Toolset = 'v120') cannot be found. To build using the v120 build tools, please install v120 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting \"Retarget solution\". [c:\\work-projects\\my-application\\node_modules\\libxml-xsd\\build\\node-libxml-xsd.vcxproj]\r\n13:16:05 gyp ERR! build error \r\n13:16:05 gyp ERR! stack Error: `C:\\Program Files (x86)\\MSBuild\\14.0\\bin\\msbuild.exe` failed with exit code: 1\r\n13:16:05 gyp ERR! stack     at ChildProcess.onExit (c:\\work-projects\\my-application\\node_modules\\node-gyp\\lib\\build.js:258:23)\r\n13:16:05 gyp ERR! stack     at emitTwo (events.js:106:13)\r\n13:16:05 gyp ERR! stack     at ChildProcess.emit (events.js:194:7)\r\n13:16:05 gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)\r\n13:16:05 gyp ERR! System Windows_NT 6.3.9600\r\n13:16:05 gyp ERR! command \"C:\\\\Program Files\\\\nodejs\\\\node.exe\" \"c:\\\\work-projects\\\\my-application\\\\node_modules\\\\node-gyp\\\\bin\\\\node-gyp.js\" \"rebuild\" \"--target=1.8.2-beta.4\" \"--arch=x64\" \"--dist-url=https://atom.io/download/electron\" \"--build-from-source\"\r\n13:16:05 gyp ERR! cwd c:\\work-projects\\my-application\\node_modules\\libxml-xsd\r\n13:16:05 gyp ERR! node -v v7.10.1\r\n13:16:05 gyp ERR! node-gyp -v v3.6.2\r\n13:16:05 gyp ERR! not ok \r\n13:16:05 \r\n13:16:05 Failed with exit code: 1\r\n```\r\n\r\n### Pertinent Code\r\n\r\nMy gulp call of electron-rebuild is pretty straightforward and crisp, so I doubt it will reveal much, but here it is :  \r\n```\r\ngulp.task('erebuild', , function () {\r\n    var eRebuild = require('electron-rebuild').rebuild;\r\n    var arch = process.arch;\r\n    eRebuild(\r\n        {buildPath: __dirname,\r\n            electronVersion: electronVersion,\r\n            arch: arch\r\n        })\r\n        .then(function () {\r\n            log('electron version: ' + electronVersion +  ' arch version: ' + arch);\r\n            log('Electron Rebuild Successful');\r\n            return true;\r\n        }).catch(function (e) {\r\n            log('Rebuilding modules against Electron didn\\'t work: ' + e);\r\n        });\r\n});\r\n```\r\n\r\n**Is there an option I should be adding to my `electron-rebuild` call to force the msvs_version value to it?**\r\n\r\nShouldn't `electron-rebuild` automatically be using this value, as `npm install` does?\r\n\r\nI notice in the `electron-rebuild` display of gyp configuration params that `msvs_version=auto` appears as its setting rather than `2015` (see about 1/3 the way down in the \"Current Issue\" section above). How do I assign `auto` the value of/or pointing to `2015` (or how do I get `electron-rebuild` to explicitly use 2015 rather than `auto`)? I am not completely sure how this should be approached.   Is this a bug in `electron-rebuild`? Should `electron-rebuild` have an option to specify `msvs_version`? Or is `auto` supposed to be a value that I set somewhere in the configuration? If so how?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/electron/electron-rebuild/issues/comments/368327203","html_url":"https://github.com/electron/electron-rebuild/issues/221#issuecomment-368327203","issue_url":"https://api.github.com/repos/electron/electron-rebuild/issues/221","id":368327203,"user":{"login":"dvanoni","id":299357,"avatar_url":"https://avatars0.githubusercontent.com/u/299357?v=4","gravatar_id":"","url":"https://api.github.com/users/dvanoni","html_url":"https://github.com/dvanoni","followers_url":"https://api.github.com/users/dvanoni/followers","following_url":"https://api.github.com/users/dvanoni/following{/other_user}","gists_url":"https://api.github.com/users/dvanoni/gists{/gist_id}","starred_url":"https://api.github.com/users/dvanoni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dvanoni/subscriptions","organizations_url":"https://api.github.com/users/dvanoni/orgs","repos_url":"https://api.github.com/users/dvanoni/repos","events_url":"https://api.github.com/users/dvanoni/events{/privacy}","received_events_url":"https://api.github.com/users/dvanoni/received_events","type":"User","site_admin":false},"created_at":"2018-02-25T17:25:56Z","updated_at":"2018-02-25T17:25:56Z","author_association":"NONE","body":"I am having this same issue. Would love to know if there's a solution."}}
{"actor":{"display_login":"dvanoni"}}