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

doesn't build in Node 6 :( #1320

Closed
alatras opened this issue Dec 4, 2018 · 7 comments
Closed

doesn't build in Node 6 :( #1320

alatras opened this issue Dec 4, 2018 · 7 comments

Comments

@alatras
Copy link

alatras commented Dec 4, 2018

I'm trying to yarn my app and building is failing with Node 6.10.3 and with other Node 6.x.x too. Here is what I am getting:

yarn install v0.17.8
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning Unmet peer dependency "babel-core@6 || 7 || ^7.0.0-alpha || ^7.0.0-beta || ^7.0.0-rc".
warning Incorrect peer dependency "typescript@2.x".
[4/4] 📃  Building fresh packages...
[1/6] ⠄ canvas: gyp info spawn args   '-Goutput_dir=.' ]
[2/6] ⠄ contextify: info spawn args   '-Goutput_dir=.' ]
[-/6] ⠄ waiting...
[-/6] ⠄ waiting...
error /the-app/app/node_modules/canvas: Command failed.
Exit code: 1
Command: sh
Arguments: -c node-gyp rebuild
Directory: /the-app/app/node_modules/canvas
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@6.10.3 | darwin | x64
gyp info spawn /usr/bin/python
gyp info spawn args [ '/Users/aa/.nvm/versions/node/v6.10.3/lib/node_modules/yarn/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/the-app/app/node_modules/canvas/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/aa/.nvm/versions/node/v6.10.3/lib/node_modules/yarn/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/aa/.node-gyp/6.10.3/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/aa/.node-gyp/6.10.3',
gyp info spawn args   '-Dnode_gyp_dir=/Users/aa/.nvm/versions/node/v6.10.3/lib/node_modules/yarn/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/aa/.node-gyp/6.10.3/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/the-app/app/node_modules/canvas',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
./util/has_lib.sh: line 31: pkg-config: command not found
gyp: Call to './util/has_lib.sh freetype' returned exit status 0 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/Users/aa/.nvm/versions/node/v6.10.3/lib/node_modules/yarn/node_modules/node-gyp/lib/configure.js:345:16)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Darwin 18.2.0
gyp ERR! command "/Users/aa/.nvm/versions/node/v6.10.3/bin/node" "/Users/aa/.nvm/versions/node/v6.10.3/lib/node_modules/yarn/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /the-app/app/node_modules/canvas
gyp ERR! node -v v6.10.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Please help!

@chearon
Copy link
Collaborator

chearon commented Dec 4, 2018

It probably works with other versions because there are prebuilds available, but node 6 on macOS doesn't build (#1317 (comment)). (Your build doesn't get as far as the error there, though, it looks like your environment isn't set up to compile node-canvas). I'll try to find some time to fix the node 6/macOS issue soon.

@alatras
Copy link
Author

alatras commented Dec 4, 2018

@chearon Thanks for your answer!
I am not quite sure I understand because a colleague of mine has the build with the same version already. But using his build on my machine gets me in different set of errors. Starting with this:

yarn start v0.17.8
$ ts-node ./src/engine/server/server 
module.js:471
    throw err;
    ^
Error: Cannot find module '/the-app/node_modules/.bin/_bin.js'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:390:7)
    at startup (bootstrap_node.js:150:9)
    at bootstrap_node.js:505:3
error Command failed with exit code 1.

@alatras alatras changed the title Doesn't build in Node 6 :( doesn't build in Node 6 :( Dec 4, 2018
@chearon
Copy link
Collaborator

chearon commented Dec 4, 2018

I don't see anything related node-canvas in that stack trace, so I can't help you with that :/

On the topic of node 6 on macOS, I'm not sure if we can support it based on the discussion in nodejs/node-gyp#469. People might be able to get it to compile on a modern macOS but I was unable to. Apparently it's possible, but risky, and if any other C++ deps other than node are built against the older libstdc++ things can get worse.

Node 6 is EOL in April anyways. @A-Atrash I think right now the best thing to do would be to upgrade to at least node 7.

@zbjornson
Copy link
Collaborator

@chearon have you seen the bit here: #1257 (comment)?

@chearon
Copy link
Collaborator

chearon commented Dec 4, 2018

I did not, looks like they got even further in the install than I can due to libstdc++ being available to them on 10.13, but apparently completely removed from Xcode in 10.14.

So far everything I've found from googling that says to add 'CLANG_CXX_LIBRARY': 'libc++' is old enough that that Xcode may have changed since then, because it doesn't work on 10.14. They may have just removed that variable since there's only one supported library now, and something is triggering it to still try and use libstdc++

@alatras
Copy link
Author

alatras commented Dec 5, 2018

@zbjornson Thanks for pointing out to the comment. It solved compiling problem for me!

@alatras
Copy link
Author

alatras commented Dec 5, 2018

@chearon Thank you too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants