tojocky / node-printer Goto Github PK
View Code? Open in Web Editor NEWNative node.js printer
Native node.js printer
HI
I have got some troubles on trying to get printers list, the method getPrinters does not return all the printers available on my computer.
After some investigations i found that the problem was related to the value of flags parameter passed in EnumPrintersW(flags, .......) see at line 407 in node_printer_win.cc file.
Indeed when i test getPrinters method on specifying the flags parameter like :
DWORD flags = PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS;
It works perfectly.
Could you make this change please ?
Thank you
I keep getting this error:
node_modules/printer/build/Release/node_printer.node: undefined symbol: cupsCreateJob
I do have the lastest libcups-dev installed, tho?
Thanks!!
Hi, I installed node-Printer with npm install printer
npm install printer --save
npm WARN package.json nw-demo@ No repository field.
npm http GET https://registry.npmjs.org/printer
npm http 200 https://registry.npmjs.org/printer
npm http GET https://registry.npmjs.org/printer/-/printer-0.0.2.tgz
npm http 200 https://registry.npmjs.org/printer/-/printer-0.0.2.tgz
[email protected] install C:\Users\Eduardo\dev\Inventory-with-node-webkit\node_mod
ules\printer
node-gyp rebuild
C:\Users\Eduardo\dev\Inventory-with-node-webkit\node_modules\printer>node "C:\Pr
ogram Files\nodejs\node_modules\npm\bin\node-gyp-bin....\node_modules\node-gy
p\bin\node-gyp.js" rebuild
Los proyectos de esta solución se van a compilar de uno en uno. Para habilitar l
a compilación en paralelo, agregue el modificador "/m".
node_printer.cc
node_printer_win.cc
C:\Users\Eduardo.node-gyp\0.10.17\deps\v8\include\v8.h(218): warning C4506: no
definition for inline function 'v8::Persistent v8::Persistent::New(v8::H
andle)' [C:\Users\Eduardo\dev\Inventory-with-node-webkit\node_modules\printe
r\build\node_printer.vcxproj]
with
T=v8::Object
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\xlocale(336): wa
rning C4530: C++ exception handler used, but unwind semantics are not enabled.
Specify /EHsc (..\src\node_printer_win.cc) [C:\Users\Eduardo\dev\Inventory-with
-node-webkit\node_modules\printer\build\node_printer.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\xmemory0(627): w
arning C4506: no definition for inline function 'v8::Persistent v8::Persiste
nt::New(v8::Handle)' [C:\Users\Eduardo\dev\Inventory-with-node-webkit\nod
e_modules\printer\build\node_printer.vcxproj]
with
T=v8::Object
Creating library C:\Users\Eduardo\dev\Inventory-with-node-webkit\node_modu
les\printer\build\Release\node_printer.lib and object C:\Users\Eduardo\dev\In
ventory-with-node-webkit\node_modules\printer\build\Release\node_printer.exp
Generating code
Finished generating code
node_printer.vcxproj -> C:\Users\Eduardo\dev\Inventory-with-node-webkit\node_
modules\printer\build\Release\node_printer.node
[email protected] node_modules\printer
Then i tried this code
var printer = require("./node_modules/printer/lib/"),
util = require('util');
console.log("supported formats are:\n"+util.inspect(printer.getSupportedPrintFormats(), {colors:true, depth:10}));
and this code
var printer = require("printer"),
util = require('util');
console.log("supported formats are:\n"+util.inspect(printer.getSupportedPrintFormats(), {colors:true, depth:10}));
When I open node-webkit I have this error.
Error: no errorC:\Users\Eduardo\dev\Inventory-with-node-webkit\node_modules\printer\build\Release\node_printer.node
at Module.load (module.js:359:32)
at Function.Module._load (module.js:315:12)
at Module.require (module.js:367:17)
at require (module.js:383:17)
at Object.eval (C:\Users\Eduardo\dev\Inventory-with-node-webkit\node_modules\printer\lib\printer.js:7:18)
at Module._compile (module.js:459:26)
at Object.Module._extensions..js (module.js:477:10)
at Module.load (module.js:359:32)
at Function.Module._load (module.js:315:12)
at Module.require (module.js:367:17)
what's wrong?
Thanks for this package, am running into some trouble getting the list of printers.
Here is my code
var printer = require("./node_modules/printer/lib"),
util = require('util');
console.log("installed printers:\n"+util.inspect(printer.getPrinters(), {colors:true, depth:10}));
The error message
pi@pi-rasp /var/www/nodejs $ node printc
/var/www/nodejs/node_modules/printer/lib/printer.js:57
var printers = printer_helper.getPrinters();
^
TypeError: wrong job status:
at Object.getPrinters (/var/www/nodejs/node_modules/printer/lib/printer.js:57:35)
at Object.<anonymous> (/var/www/nodejs/printc.js:3:58)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:929:3
Package version: 0.0.5
NodeJS: v0.10.35
CUPS version: 1.5.3
System: Linux pi-rasp 3.18.5+ #748 PREEMPT Wed Feb 4 21:24:41 GMT 2015 armv6l GNU/Linux
Here's the link to the PDF:
https://drive.google.com/file/d/0B4xBPiAxQ7h5STZPWjlGREJKd0k/view?usp=sharing
We used MS Word to create a PDF and that printed fine. The above PDF was generated using a PHP library called FPDF:
I'm using this code to print it. When we attempt to print the above PDF, the printer will get the data, but it will not print it.
printer.printDirect({
data: fs.readFileSync('./doc.pdf')
, printer: 'Ricoh Aficio MP C2500 PCL5c' // printer name, that does exist
, type: 'RAW'
, success: function (jobID) {
console.log("sent to printer with ID: " + jobID);
}
, error: function (err) {
throw new Error(err);
}
});
Error: Cannot find module '../build/Release/node_printer.node'
node -v is new
If I hop into the node console, and just do a simple
var printer = require('printer');
printer.getPrinters();
I get the array of all the printers, but when I do the exact same thing inside of node-webkit I get this error:
I'm on OSX 10.9.5. Any ideas on what I should look into?
I'm getting only the printDirect
function exposed when requiring the module.
This is the output of the module when installing:
c:\Users\dev\Code\node-printer>npm i printer
npm WARN engine [email protected]: wanted: {"node":">= 0.8.0 && < 0.9.0"} (current: {"node":"v0.10.29","npm":"1.4.14"})
|
> [email protected] install c:\Users\dev\Code\node_modules\printer
> node-gyp rebuild
c:\Users\dev\Code\node_modules\printer>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modul
es\node-gyp\bin\node-gyp.js" rebuild
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
node_printer.cc
C:\Users\dev\.node-gyp\0.10.29\deps\v8\include\v8.h(179): warning C4506: no definition for inline function 'v8::Persist
ent<v8::Object> v8::Persistent<v8::Object>::New(v8::Handle<v8::Object>)' [c:\Users\dev\Code\node_modules\printer\build\
node_printer.vcxproj]
Creating library c:\Users\dev\Code\node_modules\printer\build\Release\node_printer.lib and object c:\Users\dev\Cod
e\node_modules\printer\build\Release\node_printer.exp
Generating code
Finished generating code
node_printer.vcxproj -> c:\Users\dev\Code\node_modules\printer\build\Release\\node_printer.node
[email protected] ..\node_modules\printer
c:\Users\dev\Code\node-printer>
Info of machine:
Example:
var printer = require('printer');
console.log(printer);
returns: { printDirect: [Function: printDirect] }
Any ideas? Please advise :)
I tried install from npm but it was an old version. Then I tried
npm install https://github.com/tojocky/node-printer.git -g�
and I got the error below. I'm on windows 8.0 with node 10.25 Do you think it would help if I tried updating node?
C:\apps>npm install https://github.com/tojocky/node-printer.git -g
npm http GET https://github.com/tojocky/node-printer.git
npm http 200 https://github.com/tojocky/node-printer.git
npm ERR! not a package C:\Users\ADMINI~1\AppData\Local\Temp\npm-12852-yo89SyBA\1405565019139-0.45655751368030906\tmp.tgz
npm ERR! Error: ENOENT, open 'C:\Users\ADMINI~1\AppData\Local\Temp\npm-12852-yo89SyBA\1405565019139-0.45655751368030906\package\pa
ckage.json'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.j
s" "install" "https://github.com/tojocky/node-printer.git" "-g"
npm ERR! cwd C:\apps
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.24
npm ERR! path C:\Users\ADMINI~1\AppData\Local\Temp\npm-12852-yo89SyBA\1405565019139-0.45655751368030906\package\package.json
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\apps\npm-debug.log
npm ERR! not ok code 0
win API: EnumPrintProcessorDatatypes
Untrusted input passed in to the printer attribute of the first argument to printDirect module can allow for command injection. This may be unexpected behavior for the caller.
Confirmed on version 0.0.1
var printer = require("printer");
printer.printDirect({data:"print from Node.JS"
, printer:"`ping google.com`"
, type: "TEXT"
, success:function(){
console.log("ok");
}
, error:function(err){console.log(err);}
});
Adam Baldwin
Questions? Hit us up in #nodesecurity on freenode or email [email protected] and reference this issue.
The Node Security Project
nodesecurity.io
@nodesecurity
I am trying to get default printer on mac osx but it's throwing segmentation fault
i am running https://raw.githubusercontent.com/tojocky/node-printer/master/examples/getDefaultPrinterName.js
➜ node-printer node defaultPrinter.js
[1] 51859 segmentation fault node defaultPrinter.js
Any help would be appreciated
I have a Epson Stylus-DX7400 connected by Usb.
When I run (in Node 0.10) raw_printer example, Gnome notifies is sending job to printer and doesn't report any error (in fact, example shows in terminal jobID without problem). But printer doesn't do anything (data light doesn't blink, neither). What could I do to investigate the reason of this?
Thanks
The README.md
said:
* no dependecies;
BUT! when I try to install it:
$ npm install printer --save
info attempt registry request try #1 at 09:56:27
http request GET https://registry.npmjs.org/printer
http 304 https://registry.npmjs.org/printer
> [email protected] install /path/to/my/project
> node-gyp rebuild
/bin/sh: 1: cups-config: not found
gyp: Call to 'cups-config --libs' returned exit status 127. while trying to load binding.gyp
gyp ERR! configure error
...
I'd try to run:
$ cups-config --libs
The program 'cups-config' is currently not installed. You can install it by typing:
sudo apt-get install libcups2-dev
so??
If CUPS server has no default printer defined, cupsGetDefault2 return NULL instead of empty string.
Workaround: in node_printer_posix.cc
MY_NODE_MODULE_CALLBACK(getDefaultPrinterName)
{
MY_NODE_MODULE_HANDLESCOPE;
const char * defaultDest = cupsGetDefault2(CUPS_HTTP_DEFAULT);
if( defaultDest == NULL ) {
defaultDest = "";
}
MY_NODE_MODULE_RETURN_VALUE(V8_STRING_NEW_UTF8(defaultDest));
}
Is there any possibility to add a new printer? I really need this functionality, but before I start implementing C++ stuff, I better ask.
-- Trixt0r
Hello,
I am getting a blank page when doing:
var printer = require("printer");
var fs = require('fs')
printer.printDirect({data:fs.readFileSync('myimage.png')
, printer:'PDFCreator'
, type: 'RAW'
, success:function(jobID){
console.log("sent to printer with ID: "+jobID);
}
, error:function(err){console.log(err);}
});
i am on win7 x64.
any idea?
Would be nice to add printFile method.
an example is here: https://github.com/shipstation/node-printer
I couldn't find a license for this project. I'm hoping for something like bsd or mit since I would like to copy parts of it.
When I try to build node-printer, this is the error I get:
$ node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp info spawn python
gyp info spawn args [ '/usr/local/lib/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/hanxue/Github/node-printer/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/usr/local/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/hanxue/.node-gyp/0.10.28/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/Users/hanxue/.node-gyp/0.10.28',
gyp info spawn args '-Dmodule_root_dir=/Users/hanxue/Github/node-printer',
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 make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
CXX(target) Release/obj.target/node_printer/src/node_printer.o
CXX(target) Release/obj.target/node_printer/src/node_printer_posix.o
SOLINK_MODULE(target) Release/node_printer.node
c++: error: Kerberos: No such file or directory
c++: error: GSS: No such file or directory
c++: error: unrecognized command line option '-weak_framework'
c++: error: unrecognized command line option '-weak_framework'
make: *** [Release/node_printer.node] 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/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:807:12)
gyp ERR! System Darwin 14.0.0
gyp ERR! command "node" "/usr/local/bin/node-gyp" "rebuild"
gyp ERR! cwd /Users/hanxue/Github/node-printer
gyp ERR! node -v v0.10.28
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok
Not sure why the C++ linking step fails, and I cannot find any further information.
i use npm install printer is not work
and
i download all file and use npm install also not work .....
how can i do ???
ps. i use in windows8 is ok ~~~but now i want use in raspberry pi (arm)
i use RASPBIAN Debian Wheezy os
hi,tojocky
i am new to print on linux, i am not know ,is there a way to read from printer?
Hi,
Is it possible to send esc/pos commands to a printer with your module? If yes, could you please provide an example?
best,
Hi,when i use this moudle in my node project,i want to find out the way to use default printer without send a specific printer_name, but i hava no idea how to do?Could please tell me how?
I have to get the default printer name in a project and show it as user's default choice.
How can I achieve that using node-printer?
If there do have a way to get that, please tell me how. If not, let getPrinter(printerName) method return the default printer when printerName isn't provided maybe a good idea.
Thanks a lot.
Trying to install from node-webkit but failing. Unless I overlooked it I couldn’t find the same problem in other issues. Any ideas?
npm ERR! Failed to parse json
npm ERR! Unexpected token /
npm ERR! File: E:\WebstormProjects\innovation-sales-order-entry\www\package.json
npm ERR! Failed to parse package.json data.
npm ERR! package.json must be actual JSON, not just JavaScript.
npm ERR!
npm ERR! This is not a bug in npm.
npm ERR! Tell the package author to fix their package.json file. JSON.parse
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "printer"
npm ERR! cwd E:\WebstormProjects\innovation-sales-order-entry\www
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! file E:\WebstormProjects\innovation-sales-order-entry\www\package.json
npm ERR! code EJSONPARSE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! E:\WebstormProjects\innovation-sales-order-entry\www\npm-debug.log
npm ERR! not ok code 0
Tried the getPrinters example with linux but the only thing I get when I run it is error undefined symbol: cupsGetDests, do you have any idea what might be causing this?
there is a way to configure the automatic cutter? i use node printer with a mini printer
Hi,
Is there a way to specify the output size?
I've tried printing both a PDF file and text. Printing works fine, but for some reason it doesn't fill the whole page. Instead it just fills a small rectangle on the page (see image).
Is this something I need to set in the printer settings in my OS?
(I'm on Mac OSX Yosemite)
$ node print_raw.js
[Error: Something wrong in printDirect]
var printer = require("../lib");
printer.printDirect({data:"中文測試" // or simple String: "some text"
, printer:'櫃台' // printer name
, type: 'TEXT' // type: RAW, TEXT, PDF, JPEG, .. depends on platform
, success:function(jobID){
console.log("sent to printer with ID: "+jobID);
}
, error:function(err){console.log(err);}
});
the 中文測試 will print "@$@%?@#$@"
how can i do ???
I try to print a jpeg image and i get a error.
The node are sending the data to printer, but the printer get a error about "Filter".
The "text" printing is working.
My code:
var printer = require('printer'),
util = require('util');
printer.printDirect({data:"teste.jpeg" // or simple String: "some text"
, printer:'EPSON_PictureMate_PM_225' // printer name
, type: 'JPEG' // type: RAW, TEXT, PDF, JPEG, .. depends on platform
, success:function(jobID){
console.log("sent to printer with ID: "+jobID);
}
, error:function(err){console.log(err);}
});
how can i print .txt file?
have any Example ?
npm install printer win8 error .....
npm WARN engine [email protected]: wanted: {"node":">= 0.8.0 && < 0.9.0"} (current:
{"node":"v0.10.28","npm":"1.4.9"})
Add possibility to return default printer.
Also would be nice to print to default printer if the printer name is not specified.
https://msdn.microsoft.com/en-us/library/windows/desktop/dd144876(v=vs.85).aspx
http://cups.org/documentation.php/doc-1.7/api-cups.html?INDEX=0&Q=Default#cupsGetDefault
Hey there,
The latest commit (0b0b881) / 0.0.5 has introduced a bug where I am unable to compile on (ARM/Raspbian) Nodejs 0.12.0. Node-gyp reports that HTTP_STATUS_CONTINUE is not declared.
0.0.4 on NPM works fine.
Not an advanced Linux/Nodejs guy (yet) so apologies for any oversight on my part.
PS: great work. Your work saved me a lot of time and effort. Thank you for doing this!
npm http GET https://registry.npmjs.org/printer
npm http 304 https://registry.npmjs.org/printer
npm WARN engine [email protected]: wanted: {"node":">= 0.8.0 && < 0.9.0"} (current:
{"node":"v0.10.28","npm":"1.4.9"})
[email protected] install D:\test\node_modules\printer
node-gyp rebuild
ex: ESC @
ESC @
Name Initialize printer
Code ASCII ESC @
Hex. 1B 40
Decimal 27 64
Function Clears data from the print buffer and sets the printer to its default settings.
Details ï DIP switch settings are not reload.
ï Data in the reception buffer is maintained.
ï Macro definition information is maintained.
ï NV bit image definition information is maintained.
ï User NV memory data is maintained.
ï When page mode is selected, this recovers to standard mode.
STAR The printer is initialized by this command under the following conditions.
ï Selection of an effective paper out detector for paper out signal output (ESC c 3n)
ï Select an effective paper out detector for printing stop (ESC c 4n)
buffer write \x1B\x40 ??
How will you be licensing this thing? I hope I'm not overlooking, but I didn't see anything mentioned yet.
How can I make bold text, change font, increase font-size, etc? If it's done using the "raw" type, is there a guide for that?
Thank you!
npm install https://github.com/tojocky/node-printer.git
npm ERR! not a package /tmp/npm-7537-MVNlAfXT/github.com/tojocky/node-printer.git
npm ERR! Error: ENOENT, open '/tmp/npm-7537-MVNlAfXT/github.com/tojocky/node-printer.git-unpack/package.json'
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:
npm ERR! http://github.com/npm/npm/issues
npm ERR! System Linux 3.13.0-37-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "https://github.com/tojocky/node-printer.git"
npm ERR! cwd /home/ming/node_webkit_projects/godzilla/node_modules/printer/examples
npm ERR! node -v v0.10.30
npm ERR! npm -v 1.4.21
npm ERR! path /tmp/npm-7537-MVNlAfXT/github.com/tojocky/node-printer.git-unpack/package.json
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/ming/node_webkit_projects/godzilla/node_modules/printer/examples/npm-debug.log
npm ERR! not ok code 0
Is it possible to create a gitter room in order to discuss, have a advice from each other ?
Thank you
Thomas
your lib/printer.js#L19
said:
/** Get supported print format for printDirect
*/
module.exports.getSupportedPrintFormats = printer_helper.getSupportedPrintFormats;
There is no such function defined for windows version, so it does not build!
Hi When i try to print a raw data am getting the script does not show any error, and the print queue shows the print job. But nothing gets printed.
var printer = require("printer");
var printerName = "HP LaserJet P1007" ;
console.log("---------------------")
console.log(printer.getSupportedPrintFormats(printerName))
console.log("---------------------")
console.log(printer.getSupportedJobCommands(printerName))
console.log("---------------------")
printer.printDirect({
data:new Buffer("I will be written"),
printer: printerName,
type: "RAW" ,
success:function(jobID){
console.log("Job sent with ID: " + jobID)
var jobInfo = printer.getJob(printerName, jobID)
console.log("Job info:" + JSON.stringify(jobInfo, null, 2))
},
error:function(err){console.log(err)}
})
Console output
[ 'CANCEL',
'DELETE',
'LAST-PAGE-EJECTED',
'PAUSE',
'RESTART',
'RESUME',
Job sent with ID: 18
Job info:{
"id": 18,
"name": "HP LaserJet P1007",
"printerName": "HP LaserJet P1007",
"user": "ram",
"format": "RAW",
"priority": 1,
"size": 17,
"status": [
"PRINTING"
],
"machineName": "\RAMKISHORE",
"document": "node print job",
"notifyName": "ram",
"printProcessor": "HP1006PrintProc",
"driverName": "HP LaserJet P1007",
"position": 1,
"startTime": 0,
"untilTime": 0,
"totalPages": 1,
"time": 221645312,
"pagesPrinted": 0
}
[email protected] install /home/q2dg/node_modules/printer
node-gyp rebuild
make: Entering directory /home/q2dg/node_modules/printer/build' CXX(target) Release/obj.target/node_printer/src/node_printer.o In file included from ../src/node_printer.cc:1:0: ../src/node_printer.hpp:19:41: error: ‘Arguments’ in namespace ‘v8’ does not name a type v8::Handle<v8::Value> PrintDirect(const v8::Arguments& iArgs); ^ ../src/node_printer.hpp:19:56: error: ISO C++ forbids declaration of ‘iArgs’ with no type [-fpermissive] v8::Handle<v8::Value> PrintDirect(const v8::Arguments& iArgs); ^ ../src/node_printer.hpp:24:41: error: ‘Arguments’ in namespace ‘v8’ does not name a type v8::Handle<v8::Value> getPrinters(const v8::Arguments& iArgs); ^ ../src/node_printer.hpp:24:56: error: ISO C++ forbids declaration of ‘iArgs’ with no type [-fpermissive] v8::Handle<v8::Value> getPrinters(const v8::Arguments& iArgs); ^ ../src/node_printer.hpp:28:49: error: ‘Arguments’ in namespace ‘v8’ does not name a type v8::Handle<v8::Value> getSupportedFormats(const v8::Arguments& iArgs); ^ ../src/node_printer.hpp:28:64: error: ISO C++ forbids declaration of ‘iArgs’ with no type [-fpermissive] v8::Handle<v8::Value> getSupportedFormats(const v8::Arguments& iArgs); ^ ../src/node_printer.cc: In function ‘void initNode(v8::Handle<v8::Object>)’: ../src/node_printer.cc:5:54: error: no matching function for call to ‘NODE_SET_METHOD(v8::Handle<v8::Object>&, const char [12], v8::Handle<v8::Value> (&)(const int&))’ NODE_SET_METHOD(exports, "getPrinters", getPrinters); ^ ../src/node_printer.cc:5:54: note: candidate is: In file included from ../src/node_printer.hpp:4:0, from ../src/node_printer.cc:1: /home/q2dg/.node-gyp/0.11.13/src/node.h:194:13: note: template<class TypeName> void node::NODE_SET_METHOD(const TypeName&, const char*, v8::FunctionCallback) inline void NODE_SET_METHOD(const TypeName& recv, ^ /home/q2dg/.node-gyp/0.11.13/src/node.h:194:13: note: template argument deduction/substitution failed: ../src/node_printer.cc:5:54: note: cannot convert ‘getPrinters’ (type ‘v8::Handle<v8::Value>(const int&)’) to type ‘v8::FunctionCallback {aka void (*)(const v8::FunctionCallbackInfo<v8::Value>&)}’ NODE_SET_METHOD(exports, "getPrinters", getPrinters); ^ ../src/node_printer.cc:6:54: error: no matching function for call to ‘NODE_SET_METHOD(v8::Handle<v8::Object>&, const char [12], v8::Handle<v8::Value> (&)(const int&))’ NODE_SET_METHOD(exports, "printDirect", PrintDirect); ^ ../src/node_printer.cc:6:54: note: candidate is: In file included from ../src/node_printer.hpp:4:0, from ../src/node_printer.cc:1: /home/q2dg/.node-gyp/0.11.13/src/node.h:194:13: note: template<class TypeName> void node::NODE_SET_METHOD(const TypeName&, const char*, v8::FunctionCallback) inline void NODE_SET_METHOD(const TypeName& recv, ^ /home/q2dg/.node-gyp/0.11.13/src/node.h:194:13: note: template argument deduction/substitution failed: ../src/node_printer.cc:6:54: note: cannot convert ‘PrintDirect’ (type ‘v8::Handle<v8::Value>(const int&)’) to type ‘v8::FunctionCallback {aka void (*)(const v8::FunctionCallbackInfo<v8::Value>&)}’ NODE_SET_METHOD(exports, "printDirect", PrintDirect); ^ ../src/node_printer.cc:7:70: error: no matching function for call to ‘NODE_SET_METHOD(v8::Handle<v8::Object>&, const char [20], v8::Handle<v8::Value> (&)(const int&))’ NODE_SET_METHOD(exports, "getSupportedFormats", getSupportedFormats); ^ ../src/node_printer.cc:7:70: note: candidate is: In file included from ../src/node_printer.hpp:4:0, from ../src/node_printer.cc:1: /home/q2dg/.node-gyp/0.11.13/src/node.h:194:13: note: template<class TypeName> void node::NODE_SET_METHOD(const TypeName&, const char*, v8::FunctionCallback) inline void NODE_SET_METHOD(const TypeName& recv, ^ /home/q2dg/.node-gyp/0.11.13/src/node.h:194:13: note: template argument deduction/substitution failed: ../src/node_printer.cc:7:70: note: cannot convert ‘getSupportedFormats’ (type ‘v8::Handle<v8::Value>(const int&)’) to type ‘v8::FunctionCallback {aka void (*)(const v8::FunctionCallbackInfo<v8::Value>&)}’ NODE_SET_METHOD(exports, "getSupportedFormats", getSupportedFormats); ^ make: *** [Release/obj.target/node_printer/src/node_printer.o] Error 1 make: Leaving directory
/home/q2dg/node_modules/printer/build'
gyp ERR! build error
gyp ERR! stack Error: make
failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/q2dg/node/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1046:12)
gyp ERR! System Linux 3.14.6-200.fc20.x86_64
gyp ERR! command "node" "/home/q2dg/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/q2dg/node_modules/printer
gyp ERR! node -v v0.11.13
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the printer package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls printer
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.14.6-200.fc20.x86_64
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "Escriptori/node-printer-master"
npm ERR! cwd /home/q2dg
npm ERR! node -v v0.11.13
npm ERR! npm -v 1.4.9
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/q2dg/npm-debug.log
npm ERR! not ok code 0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.