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

Error: gyp failed with exit code: 1, lwip@0.0.8 install: node-gyp rebuild #1906

Closed
abi2810 opened this issue Oct 3, 2019 · 19 comments
Closed

Comments

@abi2810
Copy link

abi2810 commented Oct 3, 2019

Whenever I try to run npm install it always throws this error.

image

What is the issue? Im trying to configure and rebuild it, it throws the error like this

image

Someone help me to resolve this.

@richardlau
Copy link
Member

You are using an unsupported version of Node.js (5.10.1). node-gyp requires at least Node.js 6 (but that went out of support earlier this year so you should use at least Node.js 10 as 8 will go out of support at the end of this year).

@abi2810
Copy link
Author

abi2810 commented Oct 3, 2019

OMG! but for a client project, we are supposed to work on that version. lwip is also showing the same error, that also doesn't support for this version right?

@richardlau
Copy link
Member

OMG! but for a client project, we are supposed to work on that version. lwip is also showing the same error, that also doesn't support for this version right?

If it’s a similar SyntaxError then yes it would appear so.

@abi2810
Copy link
Author

abi2810 commented Oct 3, 2019

Okay, thanks for helping me out. Will upgrade to Node6 and then will try whether it is working or not.

@ericmx
Copy link

ericmx commented Oct 3, 2019

I'm actually running into a similar issue as well.

Screen Shot 2019-10-03 at 10 22 57 AM

@dwhathaway
Copy link

I also have a problem installing node-gyp. Searching around (e.g. here). It appears that there was an update to macOS somewhere along the way that might have caused an issue.

System Information:

System Version:	macOS 10.14.6 (18G95)
System Darwin 18.7.0
node -v v12.10.0
node-gyp -v v5.0.

Build Command:

gyp ERR! command "/usr/local/Cellar/node/12.10.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"

Here is my full output:

  CXX(target) Release/obj.target/fibers/src/fibers.o
../src/fibers.cc:68:2: error: no template named 'Handle'
        Handle<String> NewLatin1String(Isolate* isolate, const char* string) {
        ^
../src/fibers.cc:69:10: error: no viable conversion from returned value of type 'Local<v8::String>' to function return type 'int'
                return String::NewFromOneByte(isolate, (const uint8_t*)string, NewStringType::kNormal).ToLocalChecked();
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/fibers.cc:72:2: error: no template named 'Handle'
        Handle<String> NewLatin1Symbol(Isolate* isolate, const char* string) {
        ^
../src/fibers.cc:73:10: error: no viable conversion from returned value of type 'Local<v8::String>' to function return type 'int'
                return String::NewFromOneByte(isolate, (const uint8_t*)string, NewStringType::kNormal).ToLocalChecked();
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/fibers.cc:94:2: error: no template named 'Handle'
        Handle<Object> NewInstance(Isolate* isolate, Local<Function> fn, int argc, Local<Value> argv[]) {
        ^
../src/fibers.cc:95:10: error: no viable conversion from returned value of type 'Local<v8::Object>' to function return type 'int'
                return fn->NewInstance(isolate->GetCurrentContext(), argc, argv).ToLocalChecked();
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/fibers.cc:104:2: error: no template named 'Handle'
        Handle<Number> ToNumber(Local<Value> value) {
        ^
../src/fibers.cc:105:10: error: no viable conversion from returned value of type 'Local<v8::Number>' to function return type 'int'
                return value->ToNumber(Isolate::GetCurrent()->GetCurrentContext()).ToLocalChecked();
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/fibers.cc:126:58: error: no template named 'Handle'
        void Reset(Isolate* isolate, Persistent<T>& persistent, Handle<T> handle) {
                                                                ^
../src/fibers.cc:139:7: error: variable has incomplete type 'void'
        void SetInternalPointer(Handle<T> handle, int index, void* val) {
             ^
../src/fibers.cc:139:26: error: use of undeclared identifier 'Handle'
        void SetInternalPointer(Handle<T> handle, int index, void* val) {
                                ^
../src/fibers.cc:139:33: error: 'T' does not refer to a value
        void SetInternalPointer(Handle<T> handle, int index, void* val) {
                                       ^
../src/fibers.cc:138:18: note: declared here
        template <class T>
                        ^
../src/fibers.cc:139:36: error: use of undeclared identifier 'handle'
        void SetInternalPointer(Handle<T> handle, int index, void* val) {
                                          ^
../src/fibers.cc:139:48: error: expected '(' for function-style cast or type construction
        void SetInternalPointer(Handle<T> handle, int index, void* val) {
                                                  ~~~ ^
../src/fibers.cc:139:59: error: expected '(' for function-style cast or type construction
        void SetInternalPointer(Handle<T> handle, int index, void* val) {
                                                             ~~~~^
../src/fibers.cc:139:61: error: use of undeclared identifier 'val'
        void SetInternalPointer(Handle<T> handle, int index, void* val) {
                                                                   ^
../src/fibers.cc:139:65: error: expected ';' at end of declaration
        void SetInternalPointer(Handle<T> handle, int index, void* val) {
                                                                       ^
                                                                       ;
../src/fibers.cc:139:66: error: expected unqualified-id
        void SetInternalPointer(Handle<T> handle, int index, void* val) {
                                                                        ^
../src/fibers.cc:143:27: error: use of undeclared identifier 'Handle'
        void* GetInternalPointer(Handle<T> handle, int index) {
                                 ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Release/obj.target/fibers/src/fibers.o] Error 1
gyp 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:196:23)
gyp ERR! stack     at ChildProcess.emit (events.js:209:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 18.7.0
gyp ERR! command "/usr/local/Cellar/node/12.10.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
gyp ERR! cwd /Users/davidhathaway/projects/jfrog/artifactory-vsts-extension/tasks/ArtifactoryConan/node_modules/fibers
gyp ERR! node -v v12.10.0
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok
node-gyp exited with code: 1
Please make sure you are using a supported platform and node version. If you
would like to compile fibers on this machine please make sure you have setup your
build environment--
Windows + OS X instructions here: https://github.com/nodejs/node-gyp
Ubuntu users please run: `sudo apt-get install g++ build-essential`
Alpine users please run: `sudo apk add python make g++`
sh: nodejs: command not found
npm WARN rollback Rolling back fibers@2.0.2 failed (this is probably harmless): /Users/davidhathaway/projects/jfrog/artifactory-vsts-extension/tasks/ArtifactoryConan/node_modules/fibers is not a child of /usr/local/lib
npm WARN rollback Rolling back asyncawait@1.0.8 failed (this is probably harmless): /Users/davidhathaway/projects/jfrog/artifactory-vsts-extension/tasks/ArtifactoryConan/node_modules/asyncawait is not a child of /usr/local/lib
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! fibers@2.0.2 install: `node build.js || nodejs build.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the fibers@2.0.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/davidhathaway/.npm/_logs/2019-10-03T16_39_00_116Z-debug.log

@richardlau
Copy link
Member

richardlau commented Oct 3, 2019

I'm actually running into a similar issue as well.

Screen Shot 2019-10-03 at 10 22 57 AM

@ericmx Please open a separate issue and fill in the template. Build failed with exit code: 1 is a general something went wrong message and the actual cause is earlier in the logs (e.g. for the original problem in this issue it was the SyntaxError).

I also have a problem installing node-gyp. Searching around (e.g. here). It appears that there was an update to macOS somewhere along the way that might have caused an issue.

@dwhathaway Your problem is also unrelated to this issue (i.e. not a SyntaxError). For fibers you probably need to be using fibers@4 (you are using 2.0.2) for Node.js 12 support: laverdet/node-fibers#409

@dwhathaway
Copy link

Thanks for the nudge in the right direction @richardlau! It took me a few minutes to find, but it appear the project I'm trying to compile (Artifactory Extensions for VSTS) is using a very old library (asyncawait). I'll look into removing that dependency and submitting a pull request to Jfrog.

@ptgiang56
Copy link

ptgiang56 commented Oct 12, 2019

I got the same issue. Here is the full output:

c:\myproject\node_modules\ed25519\src\ed25519.cc(126): warning C4312: 'type cast': conversion from 'int' to 'node::addon_register_func' of greater size [C:\myproject\node_modules\ed25519\build\ed2 5519.vcxproj] gyp ERR! build error gyp ERR! stack Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exefailed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:196:23) gyp ERR! stack at ChildProcess.emit (events.js:210:5) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12) gyp ERR! System Windows_NT 10.0.17763 gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" gyp ERR! cwd C:\myproject\node_modules\ed25519 gyp ERR! node -v v12.12.0 gyp ERR! node-gyp -v v5.0.3 gyp ERR! not ok npm WARN uglifyjs-webpack-plugin@2.2.0 requires a peer of webpack@^4.0.0 but none is installed. You must install peer dependencies yourself. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ed25519@0.0.4 (node_modules\ed25519): npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ed25519@0.0.4 install:node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

audited 2983 packages in 10.976s`

Do you have any workaround or fix this issue?

@dwhathaway
Copy link

@ptgiang56 For the time being, I downgraded to node 10.16.3, which resolved my issue.

@master3395
Copy link

@ptgiang56 For the time being, I downgraded to node 10.16.3, which resolved my issue.

This solved the issue for me too!

nvm install 10.16.3
npm i node-gyp --save

@pcjmfranken
Copy link

Why was this issue closed? There's no fix, just a workaround.

Problem persists, even on the current Node LTS version 12.13.1.

@richardlau
Copy link
Member

@pcjmfranken It was closed because the issue reported was SyntaxErrors due to an out-of-date version of Node.js being used. Subsequent comments have described different problems, which should have been opened as separate issues as they were not the SyntaxErrors that were reported originally. If you're seeing a problem on current LTS it is almost certainly not the originally reported problem here and you should open a new issue describing the error you are seeing and including the full output of whatever command you are running.

@minh265tv
Copy link

minh265tv commented Nov 27, 2019

Why was this issue closed? There's no fix, just a workaround.

Problem persists, even on the current Node LTS version 12.13.1.

yes, me too...how to fix that?

@davidfabreguette
Copy link

yep same error for me !

@cclauss
Copy link
Contributor

cclauss commented Nov 28, 2019

If you're seeing a problem on current LTS it is almost certainly not the originally reported problem here and you should open a new issue describing the error you are seeing and including the full output of whatever command you are running.

@garyo
Copy link

garyo commented Dec 9, 2019

Same (or similar) error for me with node.js 13 -- failed to build fibers with node-gyp on Mac.
Downgrading node.js to 10.17 is a working workaround.
Happy to include this in another issue if there is one -- please let me know.

Error:

error /Users/garyo/dss/product/Horizon/horizon-project/node_modules/fibers: Command failed.
Exit code: 127
Command: node build.js || nodejs build.js
Arguments: 
Directory: /Users/garyo/dss/product/Horizon/horizon-project/node_modules/fibers
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@5.0.5
gyp info using node@13.2.0 | darwin | x64
gyp info find Python using Python version 2.7.16 found at "/usr/bin/python"
gyp info spawn /usr/bin/python
gyp info spawn args [
gyp info spawn args   '/usr/local/Cellar/node/13.2.0/libexec/lib/node_modules/npm/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   '/Users/garyo/dss/product/Horizon/horizon-project/node_modules/fibers/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/Cellar/node/13.2.0/libexec/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/garyo/Library/Caches/node-gyp/13.2.0/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/garyo/Library/Caches/node-gyp/13.2.0',
gyp info spawn args   '-Dnode_gyp_dir=/usr/local/Cellar/node/13.2.0/libexec/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/garyo/Library/Caches/node-gyp/13.2.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/garyo/dss/product/Horizon/horizon-project/node_modules/fibers',
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=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
../src/fibers.cc:899:12: error: no matching member function for call to 'Set'
                        target->Set(sym_yield, yield);
                        ~~~~~~~~^~~
/Users/garyo/Library/Caches/node-gyp/13.2.0/include/node/v8.h:3547:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
...

@richardlau
Copy link
Member

@garyo You're best off reporting in the fibers repository, e.g. laverdet/node-fibers#424. Those aren't node-gyp errors, they actual compatibility issues with the fibers module.

@nodejs nodejs locked as resolved and limited conversation to collaborators Dec 9, 2019
@richardlau
Copy link
Member

I've locked this issue as per #1906 (comment) the originally issue was resolved and everything else reported since should have be reported in new issues.

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

No branches or pull requests