在 Aurelia 项目中构建 node-gyp 时收到致命错误 c1083,无法打开包含文件 stddef.h

Receiving Fatal Error c1083, Cannot open include file stddef.h while building node-gyp in Aurelia Project

我已经面对这个问题好几个星期了,没有解决的希望。我是 Aurelia JavaScript Framework 的新手,我正在掌握 github.

上托管的骨架项目

我已经成功安装了nodejs、npm和jspm。作为要求的一部分,我应该 运行:

npm install

代码 运行 很好,但遇到了一个块,错误如下

C:\Users\baba\.node-gyp.4.5\include\node\v8.h(18): fatal error C1083: Cannot open include file: 'stddef.h': No such file or directory [E:\fwb\node_modules\u
tf-8-validate\build\validation.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\baba\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\nodejs\node.exe" "C:\Users\baba\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd E:\fwb\node_modules\utf-8-validate
gyp ERR! node -v v4.4.5
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok

我不知道我错过了什么或做错了什么。我将不胜感激任何帮助,使这个 运行ning 没有任何错误,或者让我朝着正确的方向迈出一步来解决这个问题。

谢谢。

这通常是因为您的计算机上没有构建软件包所需的构建工具。

在 Unix 上确保你有:

  • python(推荐v2.7,不支持v3.x.x)
  • 制作
  • 一个合适的 C/C++ 编译器工具链,比如 GCC

在 Mac OS X:

  • Xcode 您还需要通过 Xcode 安装命令行工具。您可以在菜单 Xcode -> 首选项 -> 下载下找到它 此步骤将安装 gcc 和包含 make
  • 的相关工具链

在 Windows 上:

  • Visual C++ 构建环境:

    • 选项 1:使用默认安装选项安装 Visual C++ 构建工具。

    • 选项 2:在安装过程中安装 Visual Studio 2015(或修改现有安装)和 select Common Tools for Visual C++。这也适用于免费的 Community 和 Express for Desktop 版本。