joeferner / node-oracle

node.js driver to connect with an oracle database.
MIT License
271 stars 99 forks source link

failed to build #168

Closed baldeagle closed 10 years ago

baldeagle commented 10 years ago

Trying to install on an Ubuntu 13.04 system. I've currently have the oracle-python driver working, just trying to get this one setup. Error log below, though I suspect it has to do with "Add the shared object files to the ld cache" since I don't understand the linux there.

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'install',
1 verbose cli   'oracle',
1 verbose cli   '--save' ]
2 info using npm@1.3.25
3 info using node@v0.11.11
4 warn package.json TempApp@0.0.0 No repository field.
5 warn package.json TempApp@0.0.0 No README data
6 verbose readDependencies using package.json deps
7 verbose cache add [ 'oracle', null ]
8 verbose cache add name=undefined spec="oracle" args=["oracle",null]
9 verbose parsed url { protocol: null,
9 verbose parsed url   slashes: null,
9 verbose parsed url   auth: null,
9 verbose parsed url   host: null,
9 verbose parsed url   port: null,
9 verbose parsed url   hostname: null,
9 verbose parsed url   hash: null,
9 verbose parsed url   search: null,
9 verbose parsed url   query: null,
9 verbose parsed url   pathname: 'oracle',
9 verbose parsed url   path: 'oracle',
9 verbose parsed url   href: 'oracle' }
10 silly lockFile 431364b6-oracle oracle
11 verbose lock oracle /home/d40611/.npm/431364b6-oracle.lock
12 silly lockFile 431364b6-oracle oracle
13 silly lockFile 431364b6-oracle oracle
14 verbose addNamed [ 'oracle', '' ]
15 verbose addNamed [ null, '*' ]
16 silly lockFile a4fb3172-oracle oracle@
17 verbose lock oracle@ /home/d40611/.npm/a4fb3172-oracle.lock
18 silly addNameRange { name: 'oracle', range: '*', hasData: false }
19 verbose url raw oracle
20 verbose url resolving [ 'http://registry.npmjs.org/', './oracle' ]
21 verbose url resolved http://registry.npmjs.org/oracle
22 info trying registry request attempt 1 at 15:29:39
23 verbose etag "25XXCPPPJ7R6XD9Y1A2644FRI"
24 http GET http://registry.npmjs.org/oracle
25 http 200 http://registry.npmjs.org/oracle
26 silly registry.get cb [ 200,
26 silly registry.get   { server: 'CouchDB/1.5.0 (Erlang OTP/R16B)',
26 silly registry.get     etag: '"25XXCPPPJ7R6XD9Y1A2644FRI"',
26 silly registry.get     'content-type': 'application/json',
26 silly registry.get     via: '1.1 varnish, 1.1 varnish',
26 silly registry.get     'cache-control': 'max-age=1',
26 silly registry.get     'content-length': '21680',
26 silly registry.get     'accept-ranges': 'bytes',
26 silly registry.get     date: 'Mon, 07 Apr 2014 22:29:35 GMT',
26 silly registry.get     age: '169',
26 silly registry.get     'x-served-by': 'cache-v36-ASH, cache-c31-CHI',
26 silly registry.get     'x-cache': 'MISS, MISS',
26 silly registry.get     'x-cache-hits': '0, 0',
26 silly registry.get     'x-timer': 'S1396909606.069519758,VS0,VS8,VE14,VE169361',
26 silly registry.get     vary: 'Accept',
26 silly registry.get     connection: 'close' } ]
27 silly addNameRange number 2 { name: 'oracle', range: '*', hasData: true }
28 silly addNameRange versions [ 'oracle',
28 silly addNameRange   [ '0.1.0',
28 silly addNameRange     '0.1.1',
28 silly addNameRange     '0.1.2',
28 silly addNameRange     '0.1.3',
28 silly addNameRange     '0.2.0',
28 silly addNameRange     '0.3.0',
28 silly addNameRange     '0.3.1',
28 silly addNameRange     '0.3.2',
28 silly addNameRange     '0.3.3',
28 silly addNameRange     '0.3.4',
28 silly addNameRange     '0.3.5',
28 silly addNameRange     '0.3.6' ] ]
29 verbose addNamed [ 'oracle', '0.3.6' ]
30 verbose addNamed [ '0.3.6', '0.3.6' ]
31 silly lockFile 57fab89f-oracle-0-3-6 oracle@0.3.6
32 verbose lock oracle@0.3.6 /home/d40611/.npm/57fab89f-oracle-0-3-6.lock
33 silly lockFile 57fab89f-oracle-0-3-6 oracle@0.3.6
34 silly lockFile 57fab89f-oracle-0-3-6 oracle@0.3.6
35 silly lockFile a4fb3172-oracle oracle@
36 silly lockFile a4fb3172-oracle oracle@
37 silly resolved [ { name: 'oracle',
37 silly resolved     description: 'Oracle database driver',
37 silly resolved     keywords: [ 'database', 'db', 'oracle' ],
37 silly resolved     homepage: 'https://github.com/joeferner/node-oracle',
37 silly resolved     license: 'MIT',
37 silly resolved     version: '0.3.6',
37 silly resolved     engines: { node: '>=0.6.0' },
37 silly resolved     maintainers: [ [Object], [Object], [Object] ],
37 silly resolved     bugs: { url: 'https://github.com/joeferner/node-oracle/issues' },
37 silly resolved     repository:
37 silly resolved      { type: 'git',
37 silly resolved        url: 'git://github.com/joeferner/node-oracle.git' },
37 silly resolved     dependencies: {},
37 silly resolved     devDependencies: { nodeunit: '~>0.8.0' },
37 silly resolved     scripts:
37 silly resolved      { test: 'nodeunit test/integration.js test/outparams.js',
37 silly resolved        install: 'node-gyp rebuild' },
37 silly resolved     main: './index.js',
37 silly resolved     gypfile: true,
37 silly resolved     readme: '# Oracle driver for Node.js\n\nA driver to connect to an Oracle database from node.js, leveraging the "Oracle C++ Call Interface" (OCCI)\nfor connectivity.  This is most commonly obtained as part of the Oracle Instant Client.\n\nIt is known to work with Oracle 10, 11, and 12, and has been mostly tested on Linux, but should also work on OS X and\nWindows 7+\n\n\n# Basic installation\n\n(See INSTALL.md for complete instructions for your platform.)\n\n* Prerequisites:\n  * Python 2.7 (*not* v3.x), used by node-gyp\n  * C++ Compiler toolchain (GCC, Visual Studio or similar)\n* Download the latest Oracle Instant Client Basic and SDK, and extract to the same directory.\n* Set environment variables:\n\n\t```\nOCI_LIB_DIR=/path/to/instant_client\nOCI_INCLUDE_DIR=/path/to/instant_client/sdk/include\nOCI_VERSION=<10, 11, or 12> # Integer. Optional, defaults to \'11\'\nNLS_LANG=.UTF8 # Optional, but required to support international characters\n\t```\n* Create symlinks for libclntsh and libocci in the Instant Client directory (see INSTALL.md)\n* (Linux) Install libaio\n* Configure the dynamic library path on your platform to include $OCI_LIB_DIR (see INSTALL.md)\n* `npm install oracle` to get the latest from npmjs.org\n\n\n# Examples\n\n### Basic example\n\n```javascript\nvar oracle = require(\'oracle\');\n\nvar connectData = {\n\thostname: "localhost",\n\tport: 1521,\n\tdatabase: "xe", // System ID (SID)\n\tuser: "oracle",\n\tpassword: "oracle"\n}\n\noracle.connect(connectData, function(err, connection) {\n\tif (err) { console.log("Error connecting to db:", err); return; }\n\n\tconnection.execute("SELECT systimestamp FROM dual", [], function(err, results) {\n\t\tif (err) { console.log("Error executing query:", err); return; }\n\n\t\tconsole.log(results);\n\t\tconnection.close(); // call only when query is finished executing\n\t});\n});\n```\n\n### Alternative connection using TNS\nReplace the `connectData` object above with one of the following.\n\nWithout tnsnames.ora file:\n\n```javascript\nvar connString = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=xe)))";\nvar connectData = { "tns": connString, "user": "test", "password": "test" };\n```\nWith tnsnames.ora file:\n\n```text\nDEV =\n\t(DESCRIPTION =\n\t\t(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))\n\t\t(CONNECT_DATA =\n\t\t\t(SERVER = DEDICATED)\n\t\t\t(SERVICE_NAME = orcl)\n\t\t)\n\t)\n```\n\n```javascript\nvar connectData = { "tns": "DEV", "user": "test", "password": "test" };\n```\n\n### Connection options\n\nThe following options can be set on the connection:\n\n* `connection.setAutoCommit(true/false);`\n* `connection.setPrefetchRowCount(count);` Should improve performance with large result sets\n\n### Out Params\nFollowing the basic example above, a query using a return parameter looks like this:\n\n```javascript\n\t...\n\tconnection.execute(\n\t\t"INSERT INTO person (name) VALUES (:1) RETURNING id INTO :2",\n\t\t[\'joe ferner\', new oracle.OutParam()],\n\t\tfunction(err, results) {\n\t\t\tif ( err ) { ... } \n\t\t\t// results.updateCount = 1\n\t\t\t// results.returnParam = the id of the person just inserted\n\t\t\tconnection.close();\n\t\t}\n\t);\n\t...\n```\n\nThe following OUT Params are supported in Stored Procedures:\n\n* `OCCIINT`\n* `OCCISTRING`\n* `OCCIDOUBLE`\n* `OCCIFLOAT`\n* `OCCICURSOR`\n* `OCCICLOB`\n* `OCCIDATE`\n* `OCCITIMESTAMP`\n* `OCCINUMBER`\n* `OCCIBLOB`\n\nSpecify the return type in the OutParam() constructor:\n\n```javascript\nconnection.execute("call myProc(:1,:2)", ["nodejs", new oracle.OutParam(oracle.OCCISTRING)], ...\n```\n\nWhen using `OCCISTRING`, the size can optionally be specified (default is 200 chars):\n\n```javascript\nconnection.execute("call myProc(:1,:2)", ["nodejs", new oracle.OutParam(oracle.OCCISTRING, {size: 1000})], ...\n```\nSee tests for more examples.\n\n### In/Out Params\nThe following INOUT param types are supported:\n\n* `OCCIINT`\n* `OCCISTRING`\n* `OCCIDOUBLE`\n* `OCCIFLOAT`\n* `OCCINUMBER`\n\nINOUT params are used like normal OUT params, with the optional \'in\' paramater value being passed in the options object:\n\n```javascript\nconnection.execute("call myProc(:1)", [new oracle.OutParam(oracle.OCCIINT, {in: 42})], ...\n```\n\n### Validate connection\nTo validate whether the connection is still established after some time:\n\n```javascript\nif (!connection.isConnected()) {\n\t// Do something like retire this connection from a pool\n}\n```\n\n### Dates\nFor DATE and TIMESTAMP types, the driver uses the UTC methods from the Javascript Date object. This means the DATE\nvalue stored will match the value of `new Date().toISOString()` on your client machine.  Consider this example\nfor a client machine in "GMT-0700":\n\nTable schema:\n\n```sql\nCREATE TABLE date_test (mydate DATE)\n```\n\nJavascript code:\n\n```javascript\n...\n\tvar date = new Date(2013, 11, 24, 18, 0, 1);  // Client timezone dependent\n\tconsole.log(date.toString());      // Tue Dec 24 2013 18:00:01 GMT-0700 (MST)\n\tconsole.log(date.toISOString());   // 2013-12-25T01:00:01.000Z\n\n\tconnection.execute(\n\t\t"INSERT INTO date_test (mydate) VALUES (:1) " +\n\t\t\t"RETURNING mydate, to_char(mydate, \'YYYY-MM-DD HH24:MI:SS\') INTO :2, :3",\n\t\t[date, new oracle.OutParam(oracle.OCCIDATE), new oracle.OutParam(oracle.OCCISTRING)],\n\t\tfunction(err, results) {\n\t\t\tconsole.log(results.returnParam.toString());  // Tue Dec 24 2013 18:00:01 GMT-0700 (MST)\n\t\t\tconsole.log(results.returnParam1);            // 2013-12-25 01:00:01\n\t\t}\n\t);\n...\n```\n\n### Querying large tables\n\nTo query large tables you should use a _reader_:\n\n* `reader = connection.reader(sql, args)`: creates a reader\n* `reader.nextRow(callback)`: returns the next row through the callback\n* `reader.nextRows(count, callback)` returns the next `count` rows through the callback. `count` is optional and `nextRows` uses the prefetch row count when `count` is omitted.\n* `connection.setPrefetchRowCount(count)`: configures the prefetch row count for the connection. Prefetching can have a dramatic impact on performance but uses more memory. \n\nExample:\n\n```javascript\nconnection.setPrefetchRowCount(50);\nvar reader = connection.reader("SELECT * FROM auditlogs", []);\n\nfunction doRead(cb) {\n\treader.nextRow(function(err, row) {\n\t\tif (err) return cb(err);\n\t\tif (row) {\n\t\t\t// do something with row\n\t\t\tconsole.log("got " + JSON.stringify(row));\n\t\t\t// recurse to read next record\n\t\t\treturn doRead(cb)\n\t\t} else {\n\t\t\t// we are done\n\t\t\treturn cb();\n\t\t}\n\t})\n}\n\ndoRead(function(err) {\n\tif (err) throw err; // or log it\n\tconsole.log("all records processed");\n});\n```\n\n### Large inserts or updates\n\nTo insert or update a large number of records you should use _prepared statements_ rather than individual `execute` calls on the connection object:\n\n* `statement = connection.prepare(sql)`: creates a prepared statement.\n* `statement.execute(args, callback)`: executes the prepared statement with the values in `args`. You can call this repeatedly on the same `statement`.\n\nExample:\n\n```javascript\n\nfunction doInsert(stmt, records, cb) {\n\tif (records.length > 0) {\n\t\tstmt.execute([records.shift()], function(err, count) {\n\t\t\tif (err) return cb(err);\n\t\t\tif (count !== 1) return cb(new Error("bad count: " + count));\n\t\t\t// recurse with remaining records\n\t\t\tdoInsert(stmt, records, cb);\n\t\t});\n\t} else {\n\t\t// we are done\n\t\treturn cb();\n\t}\n}\n\nvar statement = connection.prepare("INSERT INTO users (id, firstName, lastName) VALUES (:1, :2, :3)");\ndoInsert(statement, users, function(err) {\n\tif (err) throw err; // or log it\n\tconsole.log("all records inserted");\t\n});\n```\n\n# Limitations/Caveats\n\n* Currently no native support for connection pooling (forthcoming; use generic-pool for now.)\n* Currently no support for column type "Timestamp With Timezone" (Issue #67)\n* While the Oracle TIMESTAMP type provides fractional seconds up to 9 digits (nanoseconds), this will be rounded\n  to the nearest millisecond when converted to a Javascript date (a _data loss_).\n\n# Development\n* Clone the source repo\n* Follow the installation instructions to prepare your environment (using Oracle Instant Client)\n* Run `npm install` or `npm test` in the root of the source directory\n* Point to an Oracle instance of your choice.  The free Oracle Express edition works well:\n  * Oracle Express 11g: http://www.oracle.com/technetwork/database/database-technologies/express-edition/downloads/index.htmlDownload\n* Debugging:\n  * Compile node with debug symbols\n  * Use gdb/ddd or another C++ debugger to step through\n',
37 silly resolved     readmeFilename: 'README.md',
37 silly resolved     _id: 'oracle@0.3.6',
37 silly resolved     _from: 'oracle@' } ]
38 info install oracle@0.3.6 into /home/d40611/Apps/DiagnosticCharts
39 info installOne oracle@0.3.6
40 info /home/d40611/Apps/DiagnosticCharts/node_modules/oracle unbuild
41 verbose tar unpack /home/d40611/.npm/oracle/0.3.6/package.tgz
42 silly lockFile 6474b826-nosticCharts-node-modules-oracle tar:///home/d40611/Apps/DiagnosticCharts/node_modules/oracle
43 verbose lock tar:///home/d40611/Apps/DiagnosticCharts/node_modules/oracle /home/d40611/.npm/6474b826-nosticCharts-node-modules-oracle.lock
44 silly lockFile 4b1864fb-611-npm-oracle-0-3-6-package-tgz tar:///home/d40611/.npm/oracle/0.3.6/package.tgz
45 verbose lock tar:///home/d40611/.npm/oracle/0.3.6/package.tgz /home/d40611/.npm/4b1864fb-611-npm-oracle-0-3-6-package-tgz.lock
46 silly gunzTarPerm modes [ '755', '644' ]
47 silly gunzTarPerm extractEntry package.json
48 silly gunzTarPerm extractEntry .npmignore
49 silly gunzTarPerm extractEntry README.md
50 silly gunzTarPerm extractEntry LICENSE
51 silly gunzTarPerm extractEntry index.js
52 silly gunzTarPerm extractEntry INSTALL.md
53 silly gunzTarPerm extractEntry lib/oracle.js
54 silly gunzTarPerm extractEntry binding.gyp
55 silly gunzTarPerm extractEntry src/outParam.h
56 silly gunzTarPerm extractEntry src/commitBaton.h
57 silly gunzTarPerm extractEntry src/connection.h
58 silly gunzTarPerm extractEntry src/executeBaton.cpp
59 silly gunzTarPerm extractEntry src/executeBaton.h
60 silly gunzTarPerm extractEntry src/nodeOracleException.h
61 silly gunzTarPerm extractEntry src/oracle_bindings.cpp
62 silly gunzTarPerm extractEntry src/oracle_bindings.h
63 silly gunzTarPerm extractEntry src/outParam.cpp
64 silly gunzTarPerm extractEntry src/connection.cpp
65 silly gunzTarPerm extractEntry src/reader.cpp
66 silly gunzTarPerm extractEntry src/reader.h
67 silly gunzTarPerm extractEntry src/readerBaton.h
68 silly gunzTarPerm extractEntry src/rollbackBaton.h
69 silly gunzTarPerm extractEntry src/statement.cpp
70 silly gunzTarPerm extractEntry src/statement.h
71 silly gunzTarPerm extractEntry src/statementBaton.h
72 silly gunzTarPerm extractEntry src/utils.h
73 silly gunzTarPerm extractEntry test/integration.js
74 silly gunzTarPerm extractEntry test/outparams.js
75 silly gunzTarPerm extractEntry test/prepare.js
76 silly gunzTarPerm extractEntry test/reader.js
77 silly gunzTarPerm extractEntry tests-settings.json
78 silly lockFile 6474b826-nosticCharts-node-modules-oracle tar:///home/d40611/Apps/DiagnosticCharts/node_modules/oracle
79 silly lockFile 6474b826-nosticCharts-node-modules-oracle tar:///home/d40611/Apps/DiagnosticCharts/node_modules/oracle
80 silly lockFile 4b1864fb-611-npm-oracle-0-3-6-package-tgz tar:///home/d40611/.npm/oracle/0.3.6/package.tgz
81 silly lockFile 4b1864fb-611-npm-oracle-0-3-6-package-tgz tar:///home/d40611/.npm/oracle/0.3.6/package.tgz
82 info preinstall oracle@0.3.6
83 verbose readDependencies using package.json deps
84 verbose readDependencies using package.json deps
85 silly resolved []
86 verbose about to build /home/d40611/Apps/DiagnosticCharts/node_modules/oracle
87 info build /home/d40611/Apps/DiagnosticCharts/node_modules/oracle
88 verbose linkStuff [ false,
88 verbose linkStuff   false,
88 verbose linkStuff   false,
88 verbose linkStuff   '/home/d40611/Apps/DiagnosticCharts/node_modules' ]
89 info linkStuff oracle@0.3.6
90 verbose linkBins oracle@0.3.6
91 verbose linkMans oracle@0.3.6
92 verbose rebuildBundles oracle@0.3.6
93 info install oracle@0.3.6
94 verbose unsafe-perm in lifecycle false
95 info oracle@0.3.6 Failed to exec install script
96 info /home/d40611/Apps/DiagnosticCharts/node_modules/oracle unbuild
97 info preuninstall oracle@0.3.6
98 info uninstall oracle@0.3.6
99 verbose true,/home/d40611/Apps/DiagnosticCharts/node_modules,/home/d40611/Apps/DiagnosticCharts/node_modules unbuild oracle@0.3.6
100 info postuninstall oracle@0.3.6
101 error oracle@0.3.6 install: `node-gyp rebuild`
101 error Exit status 1
102 error Failed at the oracle@0.3.6 install script.
102 error This is most likely a problem with the oracle package,
102 error not with npm itself.
102 error Tell the author that this fails on your system:
102 error     node-gyp rebuild
102 error You can get their info via:
102 error     npm owner ls oracle
102 error There is likely additional logging output above.
103 error System Linux 3.8.0-35-generic
104 error command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "oracle" "--save"
105 error cwd /home/d40611/Apps/DiagnosticCharts
106 error node -v v0.11.11
107 error npm -v 1.3.25
108 error code ELIFECYCLE
109 verbose exit [ 1, true ]
johannish commented 10 years ago

I don't see any specific error message there. Could you please post the output of simply npm install oracle?

kontrafiktion commented 10 years ago

Is node.js 0.11.x already supported by the last published version of node-oracle?

Please try node.js 0.10.x

"Mr. Duffy lived a short distance from his body"

On 08.04.2014, at 00:46, baldeagle notifications@github.com wrote:

Trying to install on an Ubuntu 13.04 system. I've currently have the oracle-python driver working, just trying to get this one setup. Error log below, though I suspect it has to do with "Add the shared object files to the ld cache" since I don't understand the linux there.

0 info it worked if it ends with ok 1 verbose cli [ '/usr/local/bin/node', 1 verbose cli '/usr/local/bin/npm', 1 verbose cli 'install', 1 verbose cli 'oracle', 1 verbose cli '--save' ] 2 info using npm@1.3.25 3 info using node@v0.11.11 4 warn package.json TempApp@0.0.0 No repository field. 5 warn package.json TempApp@0.0.0 No README data 6 verbose readDependencies using package.json deps 7 verbose cache add [ 'oracle', null ] 8 verbose cache add name=undefined spec="oracle" args=["oracle",null] 9 verbose parsed url { protocol: null, 9 verbose parsed url slashes: null, 9 verbose parsed url auth: null, 9 verbose parsed url host: null, 9 verbose parsed url port: null, 9 verbose parsed url hostname: null, 9 verbose parsed url hash: null, 9 verbose parsed url search: null, 9 verbose parsed url query: null, 9 verbose parsed url pathname: 'oracle', 9 verbose parsed url path: 'oracle', 9 verbose parsed url href: 'oracle' } 10 silly lockFile 431364b6-oracle oracle 11 verbose lock oracle /home/d40611/.npm/431364b6-oracle.lock 12 silly lockFile 431364b6-oracle oracle 13 silly lockFile 431364b6-oracle oracle 14 verbose addNamed [ 'oracle', '' ] 15 verbose addNamed [ null, '' ] 16 silly lockFile a4fb3172-oracle oracle@ 17 verbose lock oracle@ /home/d40611/.npm/a4fb3172-oracle.lock 18 silly addNameRange { name: 'oracle', range: '', hasData: false } 19 verbose url raw oracle 20 verbose url resolving [ 'http://registry.npmjs.org/', './oracle' ] 21 verbose url resolved http://registry.npmjs.org/oracle 22 info trying registry request attempt 1 at 15:29:39 23 verbose etag "25XXCPPPJ7R6XD9Y1A2644FRI" 24 http GET http://registry.npmjs.org/oracle 25 http 200 http://registry.npmjs.org/oracle 26 silly registry.get cb [ 200, 26 silly registry.get { server: 'CouchDB/1.5.0 (Erlang OTP/R16B)', 26 silly registry.get etag: '"25XXCPPPJ7R6XD9Y1A2644FRI"', 26 silly registry.get 'content-type': 'application/json', 26 silly registry.get via: '1.1 varnish, 1.1 varnish', 26 silly registry.get 'cache-control': 'max-age=1', 26 silly registry.get 'content-length': '21680', 26 silly registry.get 'accept-ranges': 'bytes', 26 silly registry.get date: 'Mon, 07 Apr 2014 22:29:35 GMT', 26 silly registry.get age: '169', 26 silly registry.get 'x-served-by': 'cache-v36-ASH, cache-c31-CHI', 26 silly registry.get 'x-cache': 'MISS, MISS', 26 silly registry.get 'x-cache-hits': '0, 0', 26 silly registry.get 'x-timer': 'S1396909606.069519758,VS0,VS8,VE14,VE169361', 26 silly registry.get vary: 'Accept', 26 silly registry.get connection: 'close' } ] 27 silly addNameRange number 2 { name: 'oracle', range: '', hasData: true } 28 silly addNameRange versions [ 'oracle', 28 silly addNameRange [ '0.1.0', 28 silly addNameRange '0.1.1', 28 silly addNameRange '0.1.2', 28 silly addNameRange '0.1.3', 28 silly addNameRange '0.2.0', 28 silly addNameRange '0.3.0', 28 silly addNameRange '0.3.1', 28 silly addNameRange '0.3.2', 28 silly addNameRange '0.3.3', 28 silly addNameRange '0.3.4', 28 silly addNameRange '0.3.5', 28 silly addNameRange '0.3.6' ] ] 29 verbose addNamed [ 'oracle', '0.3.6' ] 30 verbose addNamed [ '0.3.6', '0.3.6' ] 31 silly lockFile 57fab89f-oracle-0-3-6 oracle@0.3.6 32 verbose lock oracle@0.3.6 /home/d40611/.npm/57fab89f-oracle-0-3-6.lock 33 silly lockFile 57fab89f-oracle-0-3-6 oracle@0.3.6 34 silly lockFile 57fab89f-oracle-0-3-6 oracle@0.3.6 35 silly lockFile a4fb3172-oracle oracle@ 36 silly lockFile a4fb3172-oracle oracle@ 37 silly resolved [ { name: 'oracle', 37 silly resolved description: 'Oracle database driver', 37 silly resolved keywords: [ 'database', 'db', 'oracle' ], 37 silly resolved homepage: 'https://github.com/joeferner/node-oracle', 37 silly resolved license: 'MIT', 37 silly resolved version: '0.3.6', 37 silly resolved engines: { node: '>=0.6.0' }, 37 silly resolved maintainers: [ [Object], [Object], [Object] ], 37 silly resolved bugs: { url: 'https://github.com/joeferner/node-oracle/issues' }, 37 silly resolved repository: 37 silly resolved { type: 'git', 37 silly resolved url: 'git://github.com/joeferner/node-oracle.git' }, 37 silly resolved dependencies: {}, 37 silly resolved devDependencies: { nodeunit: '~>0.8.0' }, 37 silly resolved scripts: 37 silly resolved { test: 'nodeunit test/integration.js test/outparams.js', 37 silly resolved install: 'node-gyp rebuild' }, 37 silly resolved main: './index.js', 37 silly resolved gypfile: true, 37 silly resolved readme: '# Oracle driver for Node.js\n\nA driver to connect to an Oracle database from node.js, leveraging the "Oracle C++ Call Interface" (OCCI)\nfor connectivity. This is most commonly obtained as part of the Oracle Instant Client.\n\nIt is known to work with Oracle 10, 11, and 12, and has been mostly tested on Linux, but should also work on OS X and\nWindows 7+\n\n\n# Basic installation\n\n(See INSTALL.md for complete instructions for your platform.)\n\n Prerequisites:\n * Python 2.7 (not v3.x), used by node-gyp\n * C++ Compiler toolchain (GCC, Visual Studio or similar)\n* Download the latest Oracle Instant Client Basic and SDK, and extract to the same directory.\n* Set environment variables:\n\n\t\nOCI_LIB_DIR=/path/to/instant_client\nOCI_INCLUDE_DIR=/path/to/instant_client/sdk/include\nOCI_VERSION=<10, 11, or 12> # Integer. Optional, defaults to \'11\'\nNLS_LANG=.UTF8 # Optional, but required to support international characters\n\t``! \n Crea te symlinks for libclntsh and libocci in the Instant Client directory (see INSTALL.md)\n (Linux) Install libaio\n Configure the dynamic library path on your platform to include $OCI_LIB_DIR (see INSTALL.md)\n npm install oracle to get the latest from npmjs.org\n\n\n# Examples\n\n### Basic example\n\njavascript\nvar oracle = require(\'oracle\');\n\nvar connectData = {\n\thostname: "localhost",\n\tport: 1521,\n\tdatabase: "xe", // System ID (SID)\n\tuser: "oracle",\n\tpassword: "oracle"\n}\n\noracle.connect(connectData, function(err, connection) {\n\tif (err) { console.log("Error connecting to db:", err); return; }\n\n\tconnection.execute("SELECT systimestamp FROM dual", [], function(err, results) {\n\t\tif (err) { console.log("Error executing query:", err); return; }\n\n\t\tconsole.log(results);\n\t\tconnection.close(); // call only when query is finished executing\n\t});\n});\n\n\n### Alternative connection using TNS\nReplace the connectData object above with o! ne of the following.\n\nWithout tnsnames.ora file:\n\njavascript\nvar connString = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=xe)))";\nvar connectData = { "tns": connString, "user": "test", "password": "test" };\n\nWith tnsnames.ora file:\n\ntext\nDEV =\n\t(DESCRIPTION =\n\t\t(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))\n\t\t(CONNECT_DATA =\n\t\t\t(SERVER = DEDICATED)\n\t\t\t(SERVICE_NAME = orcl)\n\t\t)\n\t)\n\n\njavascript\nvar connectData = { "tns": "DEV", "user": "test", "password": "test" };\n\n\n### Connection options\n\nThe following options can be set on the connection:\n\n connection.setAutoCommit(true/false);\n connection.setPrefetchRowCount(count); Should improve performance with large result sets\n\n### Out Params\nFollowing the basic example above, a query using a return parameter looks like this:\n\njavascript\n\t...\n\tconnection.execute(\n\t\t"INSERT INTO pers! on (name) VALUES (:1) RETURNING id INTO :2",\n\t\t[\'joe ferner\', new oracle.OutParam()],\n\t\tfunction(err, results) {\n\t\t\tif ( err ) { ... } \n\t\t\t// results.updateCount = 1\n\t\t\t// results.returnParam = the id of the person just inserted\n\t\t\tconnection.close();\n\t\t}\n\t);\n\t...\n\n\nThe following OUT Params are supported in Stored Procedures:\n\n OCCIINT\n OCCISTRING\n OCCIDOUBLE\n OCCIFLOAT\n OCCICURSOR\n OCCICLOB\n OCCIDATE\n OCCITIMESTAMP\n OCCINUMBER\n OCCIBLOB\n\nSpecify the return type in the OutParam() constructor:\n\njavascript\nconnection.execute("call myProc(:1,:2)", ["nodejs", new oracle.OutParam(oracle.OCCISTRING)], ...\n\n\nWhen using OCCISTRING, the size can optionally be specified (default is 200 chars):\n\njavascript\nconnection.execute("call myProc(:1,:2)", ["nodejs", new oracle.OutParam(oracle.OCCISTRING, {size: 1000})], ...\n\nSee tests for more examples.\n\n### In/Out Params\nThe following INOUT para! m types a re supported:\n\n OCCIINT\n OCCISTRING\n OCCIDOUBLE\n OCCIFLOAT\n OCCINUMBER\n\nINOUT params are used like normal OUT params, with the optional \'in\' paramater value being passed in the options object:\n\njavascript\nconnection.execute("call myProc(:1)", [new oracle.OutParam(oracle.OCCIINT, {in: 42})], ...\n\n\n### Validate connection\nTo validate whether the connection is still established after some time:\n\njavascript\nif (!connection.isConnected()) {\n\t// Do something like retire this connection from a pool\n}\n\n\n### Dates\nFor DATE and TIMESTAMP types, the driver uses the UTC methods from the Javascript Date object. This means the DATE\nvalue stored will match the value of new Date().toISOString() on your client machine. Consider this example\nfor a client machine in "GMT-0700":\n\nTable schema:\n\nsql\nCREATE TABLE date_test (mydate DATE)\n\n\nJavascript code:\n\njavascript\n...\n\tvar date = new Date(2013, 11, 24, 18, 0, 1);! // Clie nt timezone dependent\n\tconsole.log(date.toString()); // Tue Dec 24 2013 18:00:01 GMT-0700 (MST)\n\tconsole.log(date.toISOString()); // 2013-12-25T01:00:01.000Z\n\n\tconnection.execute(\n\t\t"INSERT INTO date_test (mydate) VALUES (:1) " +\n\t\t\t"RETURNING mydate, to_char(mydate, \'YYYY-MM-DD HH24:MI:SS\') INTO :2, :3",\n\t\t[date, new oracle.OutParam(oracle.OCCIDATE), new oracle.OutParam(oracle.OCCISTRING)],\n\t\tfunction(err, results) {\n\t\t\tconsole.log(results.returnParam.toString()); // Tue Dec 24 2013 18:00:01 GMT-0700 (MST)\n\t\t\tconsole.log(results.returnParam1); // 2013-12-25 01:00:01\n\t\t}\n\t);\n...\n\n\n### Querying large tables\n\nTo query large tables you should use a reader:\n\n reader = connection.reader(sql, args): creates a reader\n reader.nextRow(callback): returns the next row through the callback\n reader.nextRows(count, callback) returns the next count rows through the callback. count is optional and nextRows ! uses the prefetch row count when count is omitted.\n connection.setPrefetchRowCount(count): configures the prefetch row count for the connection. Prefetching can have a dramatic impact on performance but uses more memory. \n\nExample:\n\njavascript\nconnection.setPrefetchRowCount(50);\nvar reader = connection.reader("SELECT \* FROM auditlogs", []);\n\nfunction doRead(cb) {\n\treader.nextRow(function(err, row) {\n\t\tif (err) return cb(err);\n\t\tif (row) {\n\t\t\t// do something with row\n\t\t\tconsole.log("got " + JSON.stringify(row));\n\t\t\t// recurse to read next record\n\t\t\treturn doRead(cb)\n\t\t} else {\n\t\t\t// we are done\n\t\t\treturn cb();\n\t\t}\n\t})\n}\n\ndoRead(function(err) {\n\tif (err) throw err; // or log it\n\tconsole.log("all records processed");\n});\n\n\n### Large inserts or updates\n\nTo insert or update a large number of records you should use prepared statements rather than individual execute calls on the connection object:\n\n statement ! = connect ion.prepare(sql): creates a prepared statement.\n statement.execute(args, callback): executes the prepared statement with the values in args. You can call this repeatedly on the same statement.\n\nExample:\n\n`javascript\n\nfunction doInsert(stmt, records, cb) {\n\tif (records.length > 0) {\n\t\tstmt.execute([records.shift()], function(err, count) {\n\t\t\tif (err) return cb(err);\n\t\t\tif (count !== 1) return cb(new Error("bad count: " + count));\n\t\t\t// recurse with remaining records\n\t\t\tdoInsert(stmt, records, cb);\n\t\t});\n\t} else {\n\t\t// we are done\n\t\treturn cb();\n\t}\n}\n\nvar statement = connection.prepare("INSERT INTO users (id, firstName, lastName) VALUES (:1, :2, :3)");\ndoInsert(statement, users, function(err) {\n\tif (err) throw err; // or log it\n\tconsole.log("all records inserted");\t\n});\n```\n\n# Limitations/Caveats\n\n Currently no native support for connection pooling (forthcoming; use generic-pool for now.)\n Currently no su! pport for column type "Timestamp With Timezone" (Issue #67)\n While the Oracle TIMESTAMP type provides fractional seconds up to 9 digits (nanoseconds), this will be rounded\n to the nearest millisecond when converted to a Javascript date (a data loss).\n\n# Development\n Clone the source repo\n Follow the installation instructions to prepare your environment (using Oracle Instant Client)\n Runnpm installornpm testin the root of the source directory\n Point to an Oracle instance of your choice. The free Oracle Express edition works well:\n Oracle Express 11g: http://www.oracle.com/technetwork/database/database-technologies/express-edition/downloads/index.htmlDownload\n Debugging:\n Compile node with debug symbols\n Use gdb/ddd or another C++ debugger to step through\n', 37 silly resolved readmeFilename: 'README.md', 37 silly resolved _id: 'oracle@0.3.6', 37 silly resolved _from: 'oracle@' } ] 38 info install oracle@0.3.6 into /home/d40611/Apps/DiagnosticCharts 39 info installOne oracle@0.3.6 40 info /home/d40611/Apps/DiagnosticCharts/node_modules/oracle unbuild 41 verbose tar unpack /home/d40611/.npm/oracle/0.3.6/package.tgz 42 silly lockFile 6474b826-nosticCharts-node-modules-oracle tar:///home/d40611/Apps/DiagnosticCharts/node_modules/oracle 43 verbose lock tar:///home/d40611/Apps/DiagnosticCharts/node_modules/oracle /home/d40611/.npm/6474b826-nosticCharts-node-modules-oracle.lock 44 silly lockFile 4b1864fb-611-npm-oracle-0-3-6-package-tgz tar:///home/d40611/.npm/oracle/0.3.6/package.tgz 45 verbose lock tar:///home/d40611/.npm/oracle/0.3.6/package.tgz /home/d40611/.npm/4b1864fb-611-npm-oracle-0-3-6-package-tgz.lock 46 silly gunzTarPerm modes [ '755', '644' ] 47 silly gunzTarPerm extractEntry package.json 48 silly gunzTarPerm extractEntry .npmignore 49 silly gunzTarPerm extractEntry README.md 50 silly gunzTarPerm extractEntry LICENSE 51 silly gunzTarPerm extractEntry index.js 52 silly gunzTarPerm extractEntry INSTALL.md 53 silly gunzTarPerm extractEntry lib/oracle.js 54 silly gunzTarPerm extractEntry binding.gyp 55 silly gunzTarPerm extractEntry src/outParam.h 56 silly gunzTarPerm extractEntry src/commitBaton.h 57 silly gunzTarPerm extractEntry src/connection.h 58 silly gunzTarPerm extractEntry src/executeBaton.cpp 59 silly gunzTarPerm extractEntry src/executeBaton.h 60 silly gunzTarPerm extractEntry src/nodeOracleException.h 61 silly gunzTarPerm extractEntry src/oracle_bindings.cpp 62 silly gunzTarPerm extractEntry src/oracle_bindings.h 63 silly gunzTarPerm extractEntry src/outParam.cpp 64 silly gunzTarPerm extractEntry src/connection.cpp 65 silly gunzTarPerm extractEntry src/reader.cpp 66 silly gunzTarPerm extractEntry src/reader.h 67 silly gunzTarPerm extractEntry src/readerBaton.h 68 silly gunzTarPerm extractEntry src/rollbackBaton.h 69 silly gunzTarPerm extractEntry src/statement.cpp 70 silly gunzTarPerm extractEntry src/statement.h 71 silly gunzTarPerm extractEntry src/statementBaton.h 72 silly gunzTarPerm extractEntry src/utils.h 73 silly gunzTarPerm extractEntry test/integration.js 74 silly gunzTarPerm extractEntry test/outparams.js 75 silly gunzTarPerm extractEntry test/prepare.js 76 silly gunzTarPerm extractEntry test/reader.js 77 silly gunzTarPerm extractEntry tests-settings.json 78 silly lockFile 6474b826-nosticCharts-node-modules-oracle tar:///home/d40611/Apps/DiagnosticCharts/node_modules/oracle 79 silly lockFile 6474b826-nosticCharts-node-modules-oracle tar:///home/d40611/Apps/DiagnosticCharts/node_modules/oracle 80 silly lockFile 4b1864fb-611-npm-oracle-0-3-6-package-tgz tar:///home/d40611/.npm/oracle/0.3.6/package.tgz 81 silly lockFile 4b1864fb-611-npm-oracle-0-3-6-package-tgz tar:///home/d40611/.npm/oracle/0.3.6/package.tgz 82 info preinstall oracle@0.3.6 83 verbose readDependencies using package.json deps 84 verbose readDependencies using package.json deps 85 silly resolved [] 86 verbose about to build /home/d40611/Apps/DiagnosticCharts/node_modules/oracle 87 info build /home/d40611/Apps/DiagnosticCharts/node_modules/oracle 88 verbose linkStuff [ false, 88 verbose linkStuff false, 88 verbose linkStuff false, 88 verbose linkStuff '/home/d40611/Apps/DiagnosticCharts/node_modules' ] 89 info linkStuff oracle@0.3.6 90 verbose linkBins oracle@0.3.6 91 verbose linkMans oracle@0.3.6 92 verbose rebuildBundles oracle@0.3.6 93 info install oracle@0.3.6 94 verbose unsafe-perm in lifecycle false 95 info oracle@0.3.6 Failed to exec install script 96 info /home/d40611/Apps/DiagnosticCharts/node_modules/oracle unbuild 97 info preuninstall oracle@0.3.6 98 info uninstall oracle@0.3.6 99 verbose true,/home/d40611/Apps/DiagnosticCharts/node_modules,/home/d40611/Apps/DiagnosticCharts/node_modules unbuild oracle@0.3.6 100 info postuninstall oracle@0.3.6 101 error oracle@0.3.6 install:node-gyp rebuild 101 error Exit status 1 102 error Failed at the oracle@0.3.6 install script. 102 error This is most likely a problem with the oracle package, 102 error not with npm itself. 102 error Tell the author that this fails on your system: 102 error node-gyp rebuild 102 error You can get their info via: 102 error npm owner ls oracle 102 error There is likely additional logging output above. 103 error System Linux 3.8.0-35-generic 104 error command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "oracle" "--save" 105 error cwd /home/d40611/Apps/DiagnosticCharts 106 error node -v v0.11.11 107 error npm -v 1.3.25 108 error code ELIFECYCLE 109 verbose exit [ 1, true ]

Reply to this email directly or view it on GitHubhttps://github.com/joeferner/node-oracle/issues/168 .

baldeagle commented 10 years ago

That did it. Thanks! Please close this issue.