Search code examples
node.jsnpmaurelianode-gyprebuild

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


I am been facing this problem for weeks now, with no hope of being solved. I am new to Aurelia JavaScript Framework and I am getting grips around the skeleton project hosted on github.

I have successfully installed nodejs, npm and jspm. As part of the requirements I am supposed to run:

npm install

The code runs well but hits a block with the error below

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

I don't know what I am missing or doing wrong. I would appreciate any help out there to get this running without any error or to put me in a step into the right direction to solve this.

Thank you.


Solution

  • This usually happens because you do not have the necessary build tools on your computer to build the package.

    On Unix make sure you have:

    • python (v2.7 recommended, v3.x.x is not supported)
    • make
    • A proper C/C++ compiler toolchain, like GCC

    On Mac OS X:

    • Xcode You also need to install the Command Line Tools via Xcode. You can find this under the menu Xcode -> Preferences -> Downloads This step will install gcc and the related toolchain containing make

    On Windows:

    • Visual C++ Build Environment:

      • Option 1: Install Visual C++ Build Tools using the Default Install option.

      • Option 2: Install Visual Studio 2015 (or modify an existing installation) and select Common Tools for Visual C++ during setup. This also works with the free Community and Express for Desktop editions.