【问题标题】:Receiving Fatal Error c1083, Cannot open include file stddef.h while building node-gyp in Aurelia Project收到致命错误 c1083,在 Aurelia 项目中构建 node-gyp 时无法打开包含文件 stddef.h
【发布时间】:2016-10-26 03:15:24
【问题描述】:

我已经面临这个问题好几个星期了,没有希望得到解决。我是 Aurelia JavaScript 框架的新手,我正在掌握托管在 github 上的骨架项目。

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

npm install

代码运行良好,但遇到以下错误

C:\Users\baba\.node-gyp\4.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\14.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

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

谢谢。

【问题讨论】:

    标签: node.js npm aurelia node-gyp rebuild


    【解决方案1】:

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

    在 Unix 上确保你有:

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

    在 Mac OS X 上:

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

    在 Windows 上:

    • Visual C++ 构建环境:

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

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

    【讨论】:

    • 谢谢。我已经安装了 Visual Studio,但我没有选择 Common Tools 安装部分。现在一切都按预期工作。再次感谢您! :)
    猜你喜欢
    • 2011-02-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-23
    相关资源
    最近更新 更多