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

Installation failes #3

Open
ps73 opened this issue Apr 28, 2023 · 6 comments
Open

Installation failes #3

ps73 opened this issue Apr 28, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@ps73
Copy link

ps73 commented Apr 28, 2023

npm install node-twain
npm ERR! code 1
npm ERR! path /Users/username/Documents/projects/node-scanner/node_modules/node-twain
npm ERR! command failed
npm ERR! command sh -c -- node-gyp rebuild
npm ERR! CXX(target) Release/obj.target/twain/src/main.o
npm ERR!   CXX(target) Release/obj.target/twain/src/TwainSession.o
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | darwin | arm64
npm ERR! gyp info find Python using Python version 3.10.9 found at "/opt/homebrew/opt/[email protected]/bin/python3.10"
npm ERR! gyp info spawn /opt/homebrew/opt/[email protected]/bin/python3.10
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/Users/username/.nvm/versions/node/v18.12.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/username/Documents/projects/node-scanner/node_modules/node-twain/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/username/.nvm/versions/node/v18.12.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/username/Library/Caches/node-gyp/18.12.0/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/Users/username/Library/Caches/node-gyp/18.12.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/Users/username/.nvm/versions/node/v18.12.0/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/username/Library/Caches/node-gyp/18.12.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Users/username/Documents/projects/node-scanner/node_modules/node-twain',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In file included from ../src/main.cpp:2:
npm ERR! In file included from ../src/TwainSDK.h:11:
npm ERR! In file included from ../src/TwainSession.h:12:
npm ERR! ../src/twain/Common.h:201:11: warning: 'MAX' macro redefined [-Wmacro-redefined]
npm ERR!   #define MAX(a, b)  (((a) > (b)) ? (a) : (b))
npm ERR!           ^
npm ERR! /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/param.h:218:9: note: previous definition is here
npm ERR! #define MAX(a, b) (((a)>(b))?(a):(b))
npm ERR!         ^
npm ERR! In file included from ../src/main.cpp:2:
npm ERR! In file included from ../src/TwainSDK.h:11:
npm ERR! In file included from ../src/TwainSession.h:12:
npm ERR! ../src/twain/Common.h:202:11: warning: 'MIN' macro redefined [-Wmacro-redefined]
npm ERR!   #define MIN(a, b)  (((a) < (b)) ? (a) : (b))
npm ERR!           ^
npm ERR! /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/param.h:215:9: note: previous definition is here
npm ERR! #define MIN(a, b) (((a)<(b))?(a):(b))
npm ERR!         ^
npm ERR! In file included from ../src/main.cpp:2:
npm ERR! In file included from ../src/TwainSDK.h:11:
npm ERR! In file included from ../src/TwainSession.h:12:
npm ERR! ../src/twain/Common.h:207:13: warning: 'kTWAIN_DSM_DIR' macro redefined [-Wmacro-redefined]
npm ERR!     #define kTWAIN_DSM_DIR       "/Library/Frameworks/TWAINDSM.framework/Versions/Current/"
npm ERR!             ^
npm ERR! ../src/twain/Common.h:108:13: note: previous definition is here
npm ERR!     #define kTWAIN_DSM_DIR         "/usr/local/lib/"
npm ERR!             ^
npm ERR! ../src/twain/Common.h:208:13: warning: 'kTWAIN_DSM_DLL_NAME' macro redefined [-Wmacro-redefined]
npm ERR!     #define kTWAIN_DSM_DLL_NAME  "TWAINDSM"
npm ERR!             ^
npm ERR! ../src/twain/Common.h:194:11: note: previous definition is here
npm ERR!   #define kTWAIN_DSM_DLL_NAME "libtwaindsm.so"
npm ERR!           ^
npm ERR! In file included from ../src/main.cpp:2:
npm ERR! In file included from ../src/TwainSDK.h:11:
npm ERR! ../src/TwainSession.h:104:33: warning: missing field 'DSM_Entry' initializer [-Wmissing-field-initializers]
npm ERR!     TW_ENTRYPOINT gDSMEntry = {0};
npm ERR!                                 ^
npm ERR! 5 warnings generated.
npm ERR! In file included from ../src/TwainSession.cpp:5:
npm ERR! In file included from ../src/TwainSession.h:12:
npm ERR! ../src/twain/Common.h:201:11: warning: 'MAX' macro redefined [-Wmacro-redefined]
npm ERR!   #define MAX(a, b)  (((a) > (b)) ? (a) : (b))
npm ERR!           ^
npm ERR! /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/param.h:218:9: note: previous definition is here
npm ERR! #define MAX(a, b) (((a)>(b))?(a):(b))
npm ERR!         ^
npm ERR! In file included from ../src/TwainSession.cpp:5:
npm ERR! In file included from ../src/TwainSession.h:12:
npm ERR! ../src/twain/Common.h:202:11: warning: 'MIN' macro redefined [-Wmacro-redefined]
npm ERR!   #define MIN(a, b)  (((a) < (b)) ? (a) : (b))
npm ERR!           ^
npm ERR! /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/param.h:215:9: note: previous definition is here
npm ERR! #define MIN(a, b) (((a)<(b))?(a):(b))
npm ERR!         ^
npm ERR! In file included from ../src/TwainSession.cpp:5:
npm ERR! In file included from ../src/TwainSession.h:12:
npm ERR! ../src/twain/Common.h:207:13: warning: 'kTWAIN_DSM_DIR' macro redefined [-Wmacro-redefined]
npm ERR!     #define kTWAIN_DSM_DIR       "/Library/Frameworks/TWAINDSM.framework/Versions/Current/"
npm ERR!             ^
npm ERR! ../src/twain/Common.h:108:13: note: previous definition is here
npm ERR!     #define kTWAIN_DSM_DIR         "/usr/local/lib/"
npm ERR!             ^
npm ERR! ../src/twain/Common.h:208:13: warning: 'kTWAIN_DSM_DLL_NAME' macro redefined [-Wmacro-redefined]
npm ERR!     #define kTWAIN_DSM_DLL_NAME  "TWAINDSM"
npm ERR!             ^
npm ERR! ../src/twain/Common.h:194:11: note: previous definition is here
npm ERR!   #define kTWAIN_DSM_DLL_NAME "libtwaindsm.so"
npm ERR!           ^
npm ERR! In file included from ../src/TwainSession.cpp:5:
npm ERR! ../src/TwainSession.h:104:33: warning: missing field 'DSM_Entry' initializer [-Wmissing-field-initializers]
npm ERR!     TW_ENTRYPOINT gDSMEntry = {0};
npm ERR!                                 ^
npm ERR! ../src/TwainSession.cpp:61:14: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
npm ERR!     if(error = dlerror() != NULL) {
npm ERR!        ~~~~~~^~~~~~~~~~~~~~~~~~~
npm ERR! ../src/TwainSession.cpp:61:14: note: place parentheses around the assignment to silence this warning
npm ERR!     if(error = dlerror() != NULL) {
npm ERR!              ^
npm ERR!        (                        )
npm ERR! ../src/TwainSession.cpp:61:14: note: use '==' to turn this assignment into an equality comparison
npm ERR!     if(error = dlerror() != NULL) {
npm ERR!              ^
npm ERR!              ==
npm ERR! ../src/TwainSession.cpp:360:30: warning: missing field 'RefCon' initializer [-Wmissing-field-initializers]
npm ERR!     TW_CALLBACK callback = {0};
npm ERR!                              ^
npm ERR! ../src/TwainSession.cpp:524:5: error: no matching function for call to 'strcpy'
npm ERR!     strcpy(fileXfer.FileName, (fileName + ext).c_str());
npm ERR!     ^~~~~~
npm ERR! /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/string.h:79:7: note: candidate function not viable: no known conversion from 'TW_STR255' (aka 'unsigned char[256]') to 'char *' for 1st argument
npm ERR! char    *strcpy(char *__dst, const char *__src);
npm ERR!          ^
npm ERR! ../src/TwainSession.cpp:602:14: warning: unused variable 'bScanStarted' [-Wunused-variable]
npm ERR!         bool bScanStarted = false;
npm ERR!              ^
npm ERR! ../src/TwainSession.cpp:603:13: warning: unused variable 'nBytePerRow' [-Wunused-variable]
npm ERR!         int nBytePerRow = (((imageInfo.ImageWidth * imageInfo.BitsPerPixel) + 7) / 8);
npm ERR!             ^
npm ERR! 9 warnings and 1 error generated.
npm ERR! make: *** [Release/obj.target/twain/src/TwainSession.o] Error 1
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/Users/username/.nvm/versions/node/v18.12.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:201:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Darwin 21.6.0
npm ERR! gyp ERR! command "/Users/username/.nvm/versions/node/v18.12.0/bin/node" "/Users/username/.nvm/versions/node/v18.12.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /Users/username/Documents/projects/node-scanner/node_modules/node-twain
npm ERR! gyp ERR! node -v v18.12.0
npm ERR! gyp ERR! node-gyp -v v9.1.0
npm ERR! gyp ERR! not ok
@Luomusha
Copy link
Owner

Yes, because I currently only have a scanner that supports Windows and not a scanner that supports TWAIN for Mac systems. So I can't debug on Mac for the time being.
Does your scanner support a TWAIN protocol with Mac drivers?

What is the brand and model of the scanner?

@Luomusha Luomusha added the bug Something isn't working label Apr 29, 2023
@ps73
Copy link
Author

ps73 commented Apr 29, 2023

I have a Canon ImageFormula DR-C225II. It comes with Twain support and works well with other scanning software.

@ps73
Copy link
Author

ps73 commented Apr 29, 2023

You can reach out to me if there is anything I can help you with debugging this bug.

@Luomusha
Copy link
Owner

Luomusha commented May 8, 2023

Thank you.
I don't have a scanner that supports Mac, so I can't debug. I don't currently have plans to purchase a new scanner. If anyone could donate a scanner that supports Mac, it would be greatly appreciated.

@SebastianBoeckle
Copy link

I dont have a scanner to donate but the offical TWAIN Working Group has a twain-samples repository which contains sample datasources. https://github.com/twain/twain-samples

@Luomusha
Copy link
Owner

Luomusha commented Nov 2, 2023

I dont have a scanner to donate but the offical TWAIN Working Group has a twain-samples repository which contains sample datasources. https://github.com/twain/twain-samples

Yes,I develop this repo refer to this library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants