gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe`

前端 未结 5 921
长发绾君心
长发绾君心 2020-12-18 01:52

I\'m getting the following error when I run my Jenkins job. I\'ve installed MSBuild 15 and 17 and specified the correct path.

Can anyone shed some light on this? Wh

5条回答
  •  我在风中等你
    2020-12-18 02:19

    This is quite a common issue faced by users who build on a Windows based operating system. A node-gyp error means that a native module has failed to build. IMHO there has never been one single answer that has directly solved this issue in my experience. However below is a checklist I would suggest to follow if anyone else comes across node-gyp errors. You may have already tried these but just leaving it for reference.

    • Install windows build tools using npm install --global windows-build-tools. This will enable compiling of native node modules and is courtesy of felixrieseberg/windows-build-tools. Build tools include items like Python and Visual C++ packages (Python 2.7 seems to be the preferred one by node-gyp)
    • Configure node-gyp to generate the appropriate build files for your project using node-gyp configure or node-gyp configure --msvs_version=2015 in your case since you mentioned that you have installed a MSBuild 15 and 17. It would be better to stick to one and configure node-gyp to it (Go through node-gyp for more available commands such as rebuild)
    • Ensure your npm config path for Python is set correctly. If you installed the build tools manually or using the link mentioned above ensure that your npm config points to a valid installation directory

      These are just for reference and if I come across any more I will add them here as juggling node-gyp on Windows machines is something I have had trouble in the past and currently.

    This error is also commonly thrown for errors caused by native node modules such as SQLite since native bindings are unable to be found.

提交回复
热议问题