What is the current behavior?
yarn add v0.22.0
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[1/1] â ˆ sha3: Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
error C:\Users\micah\Source\temp\node_modules\sha3: Command failed.
Exit code: 1
Command: C:\Windows\system32\cmd.exe
Arguments: /d /s /c node-gyp rebuild
Directory: C:\Users\micah\Source\temp\node_modules\sha3
Output:
C:\Users\micah\Source\temp\node_modules\sha3>if not defined npm_config_node_gyp (node "C:\Program Files (x86)\Yarn\bin\node-gyp-bin\\..\..\node_modules\node-gy
p\bin\node-gyp.js" rebuild ) else (node rebuild )
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp info spawn C:\Program Files (x86)\Python27\python.EXE
gyp info spawn args [ 'C:\\Program Files (x86)\\Yarn\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'msvs',
gyp info spawn args '-G',
gyp info spawn args 'msvs_version=auto',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\micah\\Source\\temp\\node_modules\\sha3\\build\\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Program Files (x86)\\Yarn\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\micah\\.node-gyp\\6.9.5\\include\\node\\common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=C:\\Users\\micah\\.node-gyp\\6.9.5',
gyp info spawn args '-Dnode_gyp_dir=C:\\Program Files (x86)\\Yarn\\node_modules\\node-gyp',
gyp info spawn args '-Dnode_lib_file=node.lib',
gyp info spawn args '-Dmodule_root_dir=C:\\Users\\micah\\Source\\temp\\node_modules\\sha3',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'C:\\Users\\micah\\Source\\temp\\node_modules\\sha3\\build',
gyp info spawn args '-Goutput_dir=.' ]
gyp info spawn C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args '/clp:Verbosity=minimal',
gyp info spawn args '/nologo',
gyp info spawn args '/p:Configuration=Release;Platform=x64' ]
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
MSBUILD : error MSB4132: The tools version "2.0" is unrecognized. Available tools versions are "14.0", "4.0".
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files (x86)\Yarn\node_modules\node-gyp\lib\build.js:276:23)
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:215:12)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files (x86)\\Yarn\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\micah\Source\temp\node_modules\sha3
gyp ERR! node -v v6.9.5
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
If the current behavior is a bug, please provide the steps to reproduce.
mkdir tempcd tempyarn add sha3npm install sha3Please mention your node.js, yarn and operating system version.
Windows 10
Yarn 0.22.0
Node v6.9.5
NPM Version 3.10.10
MSBuild.exe version 14.0.25420.1
Note: I have installed the latest VS Build tooling and the issue persists.
yarn config set msvs_version 2015 --global resolved the issue.
yarn config set msvs_version 2017 --global did _not_ resolve the issue despite that being the version of build tooling I have installed.
This should be the default for Yarn seeing as how it is quite difficult to get MSBuild 2.0 tooling anymore. The defaults should work on the latest stable version of the OS (Windows 10) and special configuration should only be necessary if you want to run on something in alpha/beta or something that is considered legacy.
MSBUILD : error MSB4132: The tools version "2.0" is unrecognized. Available tools versions are "14.0", "4.0".
I'm fairly sure that Yarn doesn't set the tooling version, it's set by gyp. However, I'm unsure as to how gyp determines the version to use. I'd suggest filing a bug to the node-gyp project (https://github.com/nodejs/node-gyp) unless it can be shown that the bug is specifically in Yarn. Thank you! 😃
yarn config isn't part of yarn? yarn config definitely doesn't seem like part of GYP. The issue resolution was that the default yarn config doesn't make sense in the year 2017, it perhaps made sense back in the 2010 era, but not anymore.
Perhaps what you are suggesting is that yarn defaults to undefined/null for the msvs_version which results in GYP falling back to _its_ default which is way out of date?
Filed related issue over at node-gyp in case the above is accurate and the issue is that yarn is falling back to node-gyp defaults.
yarn config isn't part of yarn? yarn config definitely doesn't seem like part of GYP.
yarn config does set Yarn config, however Yarn just passes a lot of the config values as-is to any scripts ran by packages (including gyp) as environment variables. Yarn does not use msvs_version itself anywhere.
default yarn config doesn't make sense in the year 2017
Yarn has no default config for MSBuild tooling. Searching the entire repo will show that 😃 https://github.com/yarnpkg/yarn/search?utf8=%E2%9C%93&q=msvs_version&type=
That default is likely being set by node-gyp.
Guys, I don't understand, these issues are closed in both repos (yarn and node-gyp), but it's still impossible to istall sha3 with yarn on windows (while it's possible on npm)
Happens on a macOS 10.12.6 as well.
I suggest you that install these processes inside in Linux Server,I have proved myself. it's most like environment problems
Most helpful comment
Guys, I don't understand, these issues are closed in both repos (yarn and node-gyp), but it's still impossible to istall sha3 with yarn on windows (while it's possible on npm)