0

I tried to install Habitat and followed all the instructions mentioned at: https://github.com/Sitecore/Habitat/wiki/01-Getting-Started

When I run the default task as mentioned in step 5 of wiki, I keep on getting the following error (i have already executed npm install and npm install -g gulp-cli):

[10:44:53] Starting '03-Publish-All-Projects'... [10:44:53] Starting 'Build-Solution'... [10:44:53] { Error: spawn C:\Program Files (x86)\MSBuild\15.0\Bin\amd64\MSBuild. exe ENOENT at exports._errnoException (util.js:1020:11) at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32) at onErrorNT (internal/child_process.js:367:16) at _combinedTickCallback (internal/process/next_tick.js:80:11) at process._tickCallback (internal/process/next_tick.js:104:9) code: 'ENOENT', errno: 'ENOENT', syscall: 'spawn C:\Program Files (x86)\MSBuild\15.0\Bin\amd64\MSBuild.ex e', path: 'C:\Program Files (x86)\MSBuild\15.0\Bin\amd64\MSBuild.exe', spawnargs:
[ 'C:\Projects\Habitat\Habitat.sln', '/target:Clean;Build', '/verbosity:minimal', '/toolsversion:15.0', '/nologo', '/maxcpucount', '/nodeReuse:False', '/property:Configuration=Debug', '/property:Platform=Any CPU' ] } [10:44:53] MSBuild failed! [10:44:53] 'Build-Solution' errored after 36 ms [10:44:53] Error: spawn C:\Program Files (x86)\MSBuild\15.0\Bin\amd64\MSBuild.ex e ENOENT at exports._errnoException (util.js:1020:11) at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32) at onErrorNT (internal/child_process.js:367:16) at _combinedTickCallback (internal/process/next_tick.js:80:11) at process._tickCallback (internal/process/next_tick.js:104:9) [10:44:53] 'default' errored after 2.12 s [10:44:53] Error in plugin 'run-sequence(Build-Solution)' Message: spawn C:\Program Files (x86)\MSBuild\15.0\Bin\amd64\MSBuild.exe ENOENT Details: code: ENOENT errno: ENOENT syscall: spawn C:\Program Files (x86)\MSBuild\15.0\Bin\amd64\MSBuild.exe path: C:\Program Files (x86)\MSBuild\15.0\Bin\amd64\MSBuild.exe spawnargs: C:\Projects\Habitat\Habitat.sln,/target:Clean;Build,/verbosity:mi nimal,/toolsversion:15.0,/nologo,/maxcpucount,/nodeReuse:False,/property:Configu ration=Debug,/property:Platform=Any CPU Stack: Error: spawn C:\Program Files (x86)\MSBuild\15.0\Bin\amd64\MSBuild.exe ENOENT at exports._errnoException (util.js:1020:11) at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32) at onErrorNT (internal/child_process.js:367:16) at _combinedTickCallback (internal/process/next_tick.js:80:11) at process._tickCallback (internal/process/next_tick.js:104:9) [10:44:53] '03-Publish-All-Projects' errored after 49 ms [10:44:53] Error in plugin 'run-sequence(default)' Message: spawn C:\Program Files (x86)\MSBuild\15.0\Bin\amd64\MSBuild.exe ENOENT Details: code: ENOENT errno: ENOENT syscall: spawn C:\Program Files (x86)\MSBuild\15.0\Bin\amd64\MSBuild.exe path: C:\Program Files (x86)\MSBuild\15.0\Bin\amd64\MSBuild.exe spawnargs: C:\Projects\Habitat\Habitat.sln,/target:Clean;Build,/verbosity:mi nimal,/toolsversion:15.0,/nologo,/maxcpucount,/nodeReuse:False,/property:Configu ration=Debug,/property:Platform=Any CPU Stack: Error: spawn C:\Program Files (x86)\MSBuild\15.0\Bin\amd64\MSBuild.exe ENOENT at exports._errnoException (util.js:1020:11) at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32) at onErrorNT (internal/child_process.js:367:16) at _combinedTickCallback (internal/process/next_tick.js:80:11) at process._tickCallback (internal/process/next_tick.js:104:9) [10:44:53] '03-Publish-All-Projects' errored after 58 ms [10:44:53] Error in plugin 'run-sequence(Build-Solution)' Message: spawn C:\Program Files (x86)\MSBuild\15.0\Bin\amd64\MSBuild.exe ENOENT Details: code: ENOENT errno: ENOENT syscall: spawn C:\Program Files (x86)\MSBuild\15.0\Bin\amd64\MSBuild.exe path: C:\Program Files (x86)\MSBuild\15.0\Bin\amd64\MSBuild.exe spawnargs: C:\Projects\Habitat\Habitat.sln,/target:Clean;Build,/verbosity:mi nimal,/toolsversion:15.0,/nologo,/maxcpucount,/nodeReuse:False,/property:Configu ration=Debug,/property:Platform=Any CPU Stack: Error: spawn C:\Program Files (x86)\MSBuild\15.0\Bin\amd64\MSBuild.exe ENOENT at exports._errnoException (util.js:1020:11) at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32) at onErrorNT (internal/child_process.js:367:16) at _combinedTickCallback (internal/process/next_tick.js:80:11) at process._tickCallback (internal/process/next_tick.js:104:9)

Any suggetions to fix the error?

Thanks in advance.

Nicks

  • What version of Visual Studio do you have? – Richard Seal Aug 15 '17 at 12:02
  • Have you installed nodejs in your computer? – João Neto Aug 15 '17 at 12:46
  • The default Habitat repo has major dependencies on Node, NPM, Gulp and other tooling that is very problematic for developers. If you just want the site locally, and have a TDS license, I'd suggest using the TDS fork and just doing Deploy Solution. github.com/HedgehogDevelopment/Habitat/tree/TDS-latest. It simplifies it. Note: this is a comment, not an answer, as I know it doesn't resolve your specific build problem....but it resolves mine! :-) – Sean Holmesby Sep 17 '18 at 3:40
2

The newest update from Habitat is using MSBuild v15 which is included in VS 2017. Hence, you should install VS2017 or use the way from @peaks. There is also the alternative way is change the configuration in gulp-config.js by v14 instead of v15 in case you are using VS2015.

enter image description here

  • i was also facing the same issue, but now fixed after changing buildtoolversion from 15.0 to 14.0 – Pradeep Gupta Mar 27 '18 at 14:48
0

Try the following: In Visual Studio, open Tools > Options > Web Package Management > In "Locations of external tools", move the $(PATH) to the top (before .\node_modules.bin).

enter image description here

Now, in Task Runner Explorer, try running the default task.

  • Thanks for the update but even after implementing the suggested changes I am still getting the same error. Any other suggestions? – Nicks Aug 16 '17 at 5:19
  • Two suggestions: 1. Check if you have the latest NodeJS version installed in your computer. 2. Delete the folder node_modules and then run npm install again – João Neto Aug 16 '17 at 6:54
0

Make sure you have the correct build tools installed (Gulp is expecting MSBuild 15).

This is a separate download to VS2017 - look for Build Tools for VS2017 here: https://www.visualstudio.com/downloads/

0

If you are getting build error as 'Error: spawn C:\Program Files (x86)\MSBuild\15.0\Bin\amd64\MSBuild. exe ENOENT ' ensure you set the buildToolVersion: auto.

enter image description here

I was able to determine this 'auto' value, looking at the logic on the gulp-msbuild\lib\msbuild-finder.js

You can find more details in the below blog link.

https://sivalingaamorthy.wordpress.com/2018/09/17/error-spawn-cprogram-files-x86msbuild15-0binamd64msbuild-exe-enoent/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.