Locally the project I have runs fine and the npm install command completes successfully. I am using Node 11.5 and recently installed file-loader with no issues.
However when I pushed the build to VSTS and it ran the 'npm install' command I noticed in the log output that for some reason its using Node 12.13 whereas up until this point it had been Node 11.5. The command did not finish successfully and failed with the following:
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual
Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code:
1
gyp ERR! stack at ChildProcess.onExit
(D:\a\1\s\Navico.Global\Navico.Global.Web\node_modules\node-
gyp\lib\build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:210:5)
gyp ERR! stack at Process.ChildProcess._handle.onexit
(internal/child_process.js:272:12)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe"
"D:\\a\\1\\s\\Navico.Global\\Navico.Global.Web\\node_modules\\node-
gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--
libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd D:\a\1\s\Navico.Global\Navico.Global.Web\node_modules\node-
sass
gyp ERR! node -v v12.13.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm verb lifecycle [email protected]~postinstall: unsafe-perm in lifecycle true
What I have tried so far:
- Commit package-lock.json as did not commit it at first.
- Updated Node-sass from 4.9 to 4.10.
- Added file-loader to dependencies in package.json.
I am guessing something recently added (file-loader) is causing something to tell the build agent on VSTS to use Node 12.13 instead of 11.5 but not sure where to look. I am new to VSTS I have used TeamCity before and if we ever had any issues with build agents we could just remote onto the agent and fix the issue but not sure how/if that is possible in VSTS.
Any help will be greatly appreciated!
Thanks, James

