Closed naamapps closed 2 years ago
Hey @naamapps. This sounds like a macOS Monterey or M1- specific issue. Unfortunately I'm still on Intel with Big Sur so I can't reproduce. If you find the cause and fix it, I'll be happy to merge. Otherwise this will have to wait until I upgrade.
I'm not on M1 Mac. Just on macos Monterey.. I'm not sure how to check what is the cause of this.. I guess I'll wait for your solution. Thanks
Hi guys,
I've resolved the same issue by installing python2: unfortunately, python2 is not installed by default in the macOS Monterey version.
I hope it can help :)
@marlecce Your solution does not work for someone using the latest alpine image that no longer supports python2. I have a docker image node:14-alpine that I am building and I install g++, make and python3 and even configure npm to set python to python3. However when the cld is building I am getting the same error as @naamapps .
Here is the error lines that are failing:
../src/cld.cc:5:12: error: 'terminate_handler' has not been declared in 'std'
5 | using std::terminate_handler;
| ^~~~~~~~~~~~~~~~~
../src/cld.cc:6:12: error: 'unexpected_handler' has not been declared in 'std'
6 | using std::unexpected_handler;
| ^~~~~~~~~~~~~~~~~~
Here is the same error that was shown before with my node and node-gyp versions:
ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:400:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:285:12)
gyp ERR! System Linux 5.10.104-linuxkit
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /transformer/node_modules/cld
gyp ERR! node -v v14.20.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
All of the above is happening in a docker container.
To fix the issue I had to update from cld 2.5.1 to version 2.8.1.
The actual fix was in this commit: https://github.com/dachev/node-cld/commit/e0042ae65fb18f08b75b6fd19f6388561423e840 It seems at some point the obsolete code was removed in the latest alpine image of node:14-alpine and removing that line from the file might have done the trick. As mentioned cld 2.8.1 is able to compile without failing to build the cld.cc file.
Hey getting this error when trying to install on a nodejs project. Please advise, Thanks.