4

I have done a lot of searching and can't find the same error that I am facing listed anywhere.I get the following error message when trying to build node-gyp:

node-gyp build
gyp info it worked if it ends with ok
gyp info using node-gyp@3.3.1
gyp info using node@0.10.43 | darwin | x64
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: *** No rule to make target `Release/obj.target/binding/src/binding.o', needed by `Release/binding.node'.  Stop.
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/alexbromage/.nvm/v0.10.43/lib/node_modules/node-   gyp/lib/build.js:276:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Darwin 15.3.0
gyp ERR! command "node" "/Users/alexbromage/.nvm/v0.10.43/bin/node-gyp" "build"
gyp ERR! cwd /Users/alexbromage
gyp ERR! node -v v0.10.43
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok 

My binding.gyp file looks like this:

{
  "targets": [
    {
      "target_name": "binding",
      "sources": [ "src/binding.cc" ]
    }
  ]
}

I think my source reference is incorrect but I can't find what to set it to correctly. Any help appreciated

theoneinskane
  • 323
  • 1
  • 3
  • 8

1 Answers1

1

Typically when this error occurs, the sources file path(s) are not correct.

mscdex
  • 104,356
  • 15
  • 192
  • 153
  • I guessed this is the case but what should it be? The location of the binding.gyp file? – theoneinskane Mar 17 '16 at 06:59
  • Typically you put `binding.gyp` in your project's root directory and then have `src/` and other paths relative to that. With that kind of layout your `sources` should work (provided that you *do* have a file in `src/` called `binding.cc`. – mscdex Mar 17 '16 at 07:02
  • See this is why I'm confused as I don't have a src/ at all and I've followed the install instructions exactly to this point! – theoneinskane Mar 17 '16 at 07:04
  • Then where are your source files? Just change the path in `sources` accordingly. If you're following a tutorial, it would be helpful to post a link to that in your question too. – mscdex Mar 17 '16 at 07:05
  • I don't know where they are. I used npm to do the install of gyp. When I get to my computer I will find them! – theoneinskane Mar 17 '16 at 07:06
  • 1
    So I have searched and there is no src folder or binding.cc folder on my hard drive. So I cannot locate where the source is. – theoneinskane Mar 18 '16 at 10:32