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

Build native module node-pty fail with latest nwjs version #7473

Closed
hhhoney opened this issue May 12, 2020 · 2 comments
Closed

Build native module node-pty fail with latest nwjs version #7473

hhhoney opened this issue May 12, 2020 · 2 comments

Comments

@hhhoney
Copy link

hhhoney commented May 12, 2020

Hello :), I found that some native modules (like node-pty) cannot be built under latest NW & nw-gyp.

NWJS Version : 0.45.6
nw-gyp version: 3.6.5
node version: 14.2.0
Operating System : macOS 10.15.4 (19E287) & Windows 10

How to reproduce

Just run following commands

npm i --save [email protected]
cd node_modules/node-pty
nw-gyp rebuild --arch=x64 --target=0.45.6

Error Example

......
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/obj.target/pty/src/unix/pty.o
../src/unix/pty.cc:669:10: error: use of undeclared identifier 'openpty'
  return openpty(amaster, aslave, name, (termios *)termp, (winsize *)winp);
         ^
../src/unix/pty.cc:717:10: error: use of undeclared identifier 'forkpty'
  return forkpty(amaster, name, (termios *)termp, (winsize *)winp);
         ^
2 errors generated.
make: *** [Release/obj.target/pty/src/unix/pty.o] Error 1
......
@GnorTech
Copy link
Member

A workaround is to remove ~/.nw-gyp/0.45.6/src/util.h

@hhhoney
Copy link
Author

hhhoney commented May 18, 2020

Thanks, it works.

We will be rebuilding node modules in an automation process, so it will be a little bit awkward to perform this workaround inside our process.

Still looking forward to a new & updated release of nwjs! 😀

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

No branches or pull requests

2 participants