zipscene / fanny

Apache License 2.0
7 stars 3 forks source link

Error on npm install #5

Closed coguy450 closed 7 years ago

coguy450 commented 7 years ago

I'm getting an error on npm install fanny on macosx. My node and npm versions are the most up to date node: v7.7.2, npm: v4.4.1

Failed at the fanny@1.0.6 preinstall script './build_fann.sh'. Make sure you have the latest version of node.js and npm installed. If you do, this is most likely a problem with the fanny package, not with npm itself. Tell the author that this fails on your system: ./build_fann.sh Here is the content of the debug file:

3743 warn aitest@1.0.0 No repository field. 3744 verbose stack Error: fanny@1.0.6 preinstall: ./build_fann.sh 3744 verbose stack Exit status 1 3744 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:279:16) 3744 verbose stack at emitTwo (events.js:106:13) 3744 verbose stack at EventEmitter.emit (events.js:194:7) 3744 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14) 3744 verbose stack at emitTwo (events.js:106:13) 3744 verbose stack at ChildProcess.emit (events.js:194:7) 3744 verbose stack at maybeClose (internal/child_process.js:899:16) 3744 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) 3745 verbose pkgid fanny@1.0.6 3746 verbose cwd //Documents/AITtest 3747 verbose Darwin 15.6.0 3748 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--save" "fanny" 3749 verbose node v7.7.2 3750 verbose npm v4.4.1 3751 error code ELIFECYCLE 3752 error errno 1

Let me know if you need any other info, thanks for your help

CrispyConductor commented 7 years ago

Can you include some additional text above the log that you pasted? It looks like it failed while building FANN itself, and the actual error would have been above that log.

coguy450 commented 7 years ago

Thanks for your response, I have included the entire logfile. Hope that helps.

2017-03-13T23_46_34_697Z-debug.txt

CrispyConductor commented 7 years ago

Actually the error will be on stdout, not in the npm log. The error is coming from the shell script build_fann.sh, and since that's not part of npm, its output doesn't go into the npm log. Can you include the rest of the standard output?

coguy450 commented 7 years ago

canning dependencies of target fann_tests [ 84%] Building CXX object tests/CMakeFiles/fann_tests.dir/main.cpp.o [ 88%] Building CXX object tests/CMakeFiles/fann_tests.dir/fann_test.cpp.o /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/tests/fann_test.cpp:27:5: warning: 'delete' applied to a pointer that was allocated with 'new[]'; did you mean 'delete[]'? [-Wmismatched-new-delete] delete layers_res; ^ [] /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/tests/fann_test.cpp:22:32: note: allocated with 'new[]' here unsigned int *layers_res = new unsigned int[numLayers]; ^ 1 warning generated. [ 92%] Building CXX object tests/CMakeFiles/fann_tests.dir/fann_test_data.cpp.o [ 96%] Building CXX object tests/CMakeFiles/fann_tests.dir/fann_test_train.cpp.o [100%] Linking CXX executable fann_tests [100%] Built target fann_tests [ 8%] Built target fann_static [ 16%] Built target fann [ 24%] Built target fixedfann_static [ 32%] Built target fixedfann [ 40%] Built target floatfann [ 48%] Built target doublefann_static [ 56%] Built target floatfann_static [ 64%] Built target doublefann [ 72%] Built target gtest [ 80%] Built target gtest_main [100%] Built target fann_tests Install the project... -- Install configuration: "Release" -- Installing: /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/fann/lib/pkgconfig/fann.pc -- Installing: /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/fann/lib/cmake/fann/fann-config.cmake -- Installing: /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/fann/lib/cmake/fann/fann-use.cmake -- Installing: /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/fann/lib/libfloatfann.2.2.0.dylib -- Installing: /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/fann/lib/libfloatfann.2.dylib -- Installing: /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/fann/lib/libfloatfann.dylib -- Installing: /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/fann/lib/libfloatfann.a -- Installing: /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/fann/lib/libdoublefann.2.2.0.dylib -- Installing: /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/fann/lib/libdoublefann.2.dylib -- Installing: /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/fann/lib/libdoublefann.dylib -- Installing: /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/fann/lib/libdoublefann.a -- Installing: /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/fann/lib/libfixedfann.2.2.0.dylib -- Installing: /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/fann/lib/libfixedfann.2.dylib -- Installing: /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/fann/lib/libfixedfann.dylib -- Installing: /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/fann/lib/libfixedfann.a -- Installing: /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/fann/lib/libfann.2.2.0.dylib -- Installing: /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/fann/lib/libfann.2.dylib -- Installing: /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/fann/lib/libfann.dylib -- Installing: /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/fann/lib/libfann.a -- Installing: /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/fann/include/fann.h -- Installing: /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/fann/include/doublefann.h -- Installing: /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/fann/include/fann_internal.h -- Installing: /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/fann/include/floatfann.h -- Installing: /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/fann/include/fann_data.h -- Installing: /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/fann/include/fixedfann.h -- Installing: /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/fann/include/fann_activation.h -- Installing: /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/fann/include/fann_cascade.h -- Installing: /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/fann/include/fann_error.h -- Installing: /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/fann/include/fann_train.h -- Installing: /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/fann/include/fann_io.h -- Installing: /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/fann/include/fann_cpp.h -- Installing: /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/fann/include/fann_data_cpp.h -- Installing: /Users/erichartmann/Documents/AITtest/node_modules/.staging/fanny-83e47727/fann/src/fann/fann/include/fann_training_data_cpp.h FANN built

fanny@1.0.7 postinstall /Users/erichartmann/Documents/AITtest/node_modules/fanny node-gyp configure && node-gyp build

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

CXX(target) Release/obj.target/addon-doublefann/src/addon.o CXX(target) Release/obj.target/addon-doublefann/src/fanny.o ../src/fanny.cc:1350:15: error: no member named 'COS' in namespace 'FANN' case FANN::COS: str = "COS"; break;


../src/fanny.cc:1351:15: error: no member named 'SIN' in namespace 'FANN'
                        case FANN::SIN: str = "SIN"; break;
                             ~~~~~~^
../src/fanny.cc:1397:51: error: no member named 'COS' in namespace 'FANN'
                                else if (str.compare("COS") == 0) ret = FANN::COS;
                                                                        ~~~~~~^
../src/fanny.cc:1398:51: error: no member named 'SIN' in namespace 'FANN'
                                else if (str.compare("SIN") == 0) ret = FANN::SIN;
                                                                        ~~~~~~^
../src/fanny.cc:1772:27: error: no member named 'get_user_data_string' in 'FANN::neural_net'
        char *str = fanny->fann->get_user_data_string();
                    ~~~~~~~~~~~  ^
../src/fanny.cc:1784:15: error: no member named 'set_user_data_string' in 'FANN::neural_net'
        fanny->fann->set_user_data_string(*utf8String);
        ~~~~~~~~~~~  ^
6 errors generated.
make: *** [Release/obj.target/addon-doublefann/src/fanny.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:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:194:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Darwin 15.6.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build"
gyp ERR! cwd /Users/erichartmann/Documents/AITtest/node_modules/fanny
gyp ERR! node -v v7.7.2
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok 
npm WARN aitest@1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! fanny@1.0.7 postinstall: `node-gyp configure && node-gyp build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the fanny@1.0.7 postinstall script 'node-gyp configure && node-gyp build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the fanny package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp configure && node-gyp build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs fanny
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls fanny
npm ERR! There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
CrispyConductor commented 7 years ago

It looks like the compiler is using the include files from the wrong version of FANN. fanny builds its own, local version of FANN as part of the install process, based on a maintained fork of FANN with a number of bugfixes. Those compilation errors are because those symbols are missing from the stock version of FANN due to a bug.

It appears that you have another version of FANN installed globally on your system. The binding.gyp file does include the appropriate directives (to my knowledge) to include and link against the locally-built version of FANN, and usually these override any system-installed versions, but I haven't tested this on a Mac.

A quick fix might be to uninstall your global version of FANN to see if the compiler will then prefer the locally-built version. Or, if you'd prefer (or if that doesn't work), you can try installing the maintained fork globally. It's fully compatible with the main fork, just with bugfixes and a handful of extra small features.

Let me know if this works for you, or if you find a better solution that gets the compiler to prefer the local version for Macs :)

coguy450 commented 7 years ago

I tried this on my work mac, which doesn't have any versions of FANN installed, I got the following message, is this still pointing to a version issue? This all might just be over my head.

Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/tests/fann_test.cpp:27:5: warning: 'delete' applied to a pointer that was allocated with 'new[]'; did you mean 'delete[]'? [-Wmismatched-new-delete] delete layers_res; ^ [] /Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/tests/fann_test.cpp:22:32: note: allocated with 'new[]' here unsigned int *layers_res = new unsigned int[numLayers]; ^ 1 warning generated. [ 92%] Building CXX object tests/CMakeFiles/fann_tests.dir/fann_test_data.cpp.o [ 96%] Building CXX object tests/CMakeFiles/fann_tests.dir/fann_test_train.cpp.o [100%] Linking CXX executable fann_tests [100%] Built target fann_tests [ 8%] Built target fann_static [ 16%] Built target fann [ 24%] Built target fixedfann_static [ 32%] Built target fixedfann [ 40%] Built target floatfann [ 48%] Built target doublefann_static [ 56%] Built target floatfann_static [ 64%] Built target doublefann [ 72%] Built target gtest [ 80%] Built target gtest_main [100%] Built target fann_tests Install the project... -- Install configuration: "Release" -- Installing: /Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/fann/lib/pkgconfig/fann.pc -- Installing: /Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/fann/lib/cmake/fann/fann-config.cmake -- Installing: /Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/fann/lib/cmake/fann/fann-use.cmake -- Installing: /Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/fann/lib/libfloatfann.2.2.0.dylib -- Installing: /Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/fann/lib/libfloatfann.2.dylib -- Installing: /Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/fann/lib/libfloatfann.dylib -- Installing: /Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/fann/lib/libfloatfann.a -- Installing: /Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/fann/lib/libdoublefann.2.2.0.dylib -- Installing: /Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/fann/lib/libdoublefann.2.dylib -- Installing: /Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/fann/lib/libdoublefann.dylib -- Installing: /Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/fann/lib/libdoublefann.a -- Installing: /Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/fann/lib/libfixedfann.2.2.0.dylib -- Installing: /Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/fann/lib/libfixedfann.2.dylib -- Installing: /Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/fann/lib/libfixedfann.dylib -- Installing: /Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/fann/lib/libfixedfann.a -- Installing: /Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/fann/lib/libfann.2.2.0.dylib -- Installing: /Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/fann/lib/libfann.2.dylib -- Installing: /Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/fann/lib/libfann.dylib -- Installing: /Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/fann/lib/libfann.a -- Installing: /Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/fann/include/fann.h -- Installing: /Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/fann/include/doublefann.h -- Installing: /Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/fann/include/fann_internal.h -- Installing: /Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/fann/include/floatfann.h -- Installing: /Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/fann/include/fann_data.h -- Installing: /Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/fann/include/fixedfann.h -- Installing: /Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/fann/include/fann_activation.h -- Installing: /Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/fann/include/fann_cascade.h -- Installing: /Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/fann/include/fann_error.h -- Installing: /Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/fann/include/fann_train.h -- Installing: /Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/fann/include/fann_io.h -- Installing: /Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/fann/include/fann_cpp.h -- Installing: /Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/fann/include/fann_data_cpp.h -- Installing: /Users/ehartmann/node_modules/.staging/fanny-84b335e4/fann/src/fann/fann/include/fann_training_data_cpp.h FANN built

fanny@1.0.7 postinstall /Users/ehartmann/node_modules/fanny node-gyp configure && node-gyp build

CXX(target) Release/obj.target/addon-doublefann/src/addon.o In file included from ../src/addon.cc:2: In file included from ../src/fanny.h:5: ../src/fann-includes.h:4:10: fatal error: 'doublefann.h' file not found

include

     ^

1 error generated. make: *** [Release/obj.target/addon-doublefann/src/addon.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:276:23) 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 15.6.0 gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" gyp ERR! cwd /Users/ehartmann/node_modules/fanny gyp ERR! node -v v6.9.1 gyp ERR! node-gyp -v v3.4.0 gyp ERR! not ok npm WARN enoent ENOENT: no such file or directory, open '/Users/ehartmann/package.json' npm WARN ehartmann No description npm WARN ehartmann No repository field. npm WARN ehartmann No README data npm WARN ehartmann No license field. npm ERR! Darwin 15.6.0 npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "fanny" npm ERR! node v6.9.1 npm ERR! npm v3.10.8 npm ERR! code ELIFECYCLE

CrispyConductor commented 7 years ago

No, that looks like a different error. This time it looks like the compiler isn't looking in the right place for the FANN include files (probably related to the last error though). What compiler are you using? Is it gcc or something else?

Regardless, it's likely that the compiler just isn't recognizing the option to point it at the local install of FANN. If this is indeed the case, it's likely that doing a system-wide install of the FANN fork will resolve the issue (because I assume that the compiler will be able to find the include files in the system location even if it doesn't recognize the option to look for them in the local install).

coguy450 commented 7 years ago

Ya, that doesn't work either, bunches of errors. This must be a hardcore linux thing, way over this Javascript developer's head, let's just close the issue, I give up.

danil-z commented 7 years ago

fanny@1.0.8 postinstall /Volumes/mars/Users/danil/Developer/myfann/node_modules/fanny node-gyp configure && node-gyp build

CXX(target) Release/obj.target/addon-doublefann/src/addon.o In file included from ../src/addon.cc:2: In file included from ../src/fanny.h:5: ../src/fann-includes.h:4:10: fatal error: 'doublefann.h' file not found

include

     ^~~~~~~~~~~~~~

1 error generated. make: *** [Release/obj.target/addon-doublefann/src/addon.o] Error 1 gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2