Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when running npm install on macOS #13

Closed
TheCJGCJG opened this issue Oct 24, 2018 · 9 comments
Closed

Issue when running npm install on macOS #13

TheCJGCJG opened this issue Oct 24, 2018 · 9 comments
Labels
bug build issue Issues that have to do with building the package

Comments

@TheCJGCJG
Copy link

TheCJGCJG commented Oct 24, 2018

When running NPM install on macOS, with node-lzo as a dependency, the following error occurs.

Node version v8.10.0, macOS Mojave

The issue can be worked around by adding "lzo": "0.4.7" as a dependency of my project.

> node-gyp rebuild

  CXX(target) Release/obj.target/node_lzo/lib/lzo.o
../lib/lzo.cc:120:1: error: C++ requires a type specifier for all declarations
NODE_MODULE_INIT(/* exports, module, context */) {
^
../lib/lzo.cc:121:10: error: use of undeclared identifier 'exports'
    Init(exports, context);
         ^
../lib/lzo.cc:121:19: error: use of undeclared identifier 'context'
    Init(exports, context);
                  ^
3 errors generated.
make: *** [Release/obj.target/node_lzo/lib/lzo.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/thecjgcjg/.nvm/versions/node/v8.10.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Darwin 18.0.0
gyp ERR! command "/Users/thecjgcjg/.nvm/versions/node/v8.10.0/bin/node" "/Users/thecjgcjg/.nvm/versions/node/v8.10.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/thecjgcjg/Sites/project/Main Stack/node_modules/lzo
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
@schroffl
Copy link
Owner

Yes, I noticed this as well after merging #11 (see #10) and releasing Version 4.8.0. This is probably due to the changes in the Addon API. I will check it out :)

@schroffl
Copy link
Owner

Published in Version 0.4.9

@terrisgit
Copy link

I have this issue with 0.4.9 on High Sierra

gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 10.0.0 (clang-1000.11.45.2)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

@ellis
Copy link

ellis commented Dec 4, 2018

Thanks for the work-around @TheCJGCJG

@schroffl With version 0.4.9, I'm seeing the same error on OS X Yosemite (10.10.5):

> [email protected] install [...]/node_modules/lzo
> node-gyp rebuild

  CXX(target) Release/obj.target/node_lzo/lib/lzo.o
../lib/lzo.cc:121:3: error: C++ requires a type specifier for all declarations
  NODE_MODULE_INIT(/* exports, module, context */) {
  ^
../lib/lzo.cc:122:12: error: use of undeclared identifier 'exports'
      Init(exports, context);
           ^
../lib/lzo.cc:122:21: error: use of undeclared identifier 'context'
      Init(exports, context);
                    ^

@schroffl
Copy link
Owner

schroffl commented Dec 4, 2018

@ellis, @terrisgit Which version of node are you running?

@ellis
Copy link

ellis commented Dec 4, 2018

@schroffl I'm running v10.6.0 on that machine.

% node --version
v10.6.0

@schroffl
Copy link
Owner

schroffl commented Dec 4, 2018

Oh, it only compiles from Version 10.7.0 upwards, but the fix in 634b1c7 introduced this check, which only looks at the major node version and that is 10 in both cases.

@schroffl schroffl reopened this Dec 4, 2018
@ellis
Copy link

ellis commented Dec 4, 2018

Cool, thanks for your help!

@schroffl
Copy link
Owner

schroffl commented Dec 4, 2018

Published in Version 0.4.10

@schroffl schroffl added the build issue Issues that have to do with building the package label May 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug build issue Issues that have to do with building the package
Projects
None yet
Development

No branches or pull requests

4 participants