1

最近是否有用于 dashDB 模块升级的“ibm_db”?我们一直在使用 Bluemix node.js 和 ibm_db 模块来访问 dashDB。该模块工作正常,但现在在 10.5.2016 上,该模块不再在 Bluemix 上编译。我们一直使用的版本在 package.json 中定义为 ibm_db ^0.0.15。以下是 Bluemix 构建错误日志的示例。

----->Building dependencies
   Prebuild detected (node_modules already exists)
   Rebuilding any native modules
   > ibm_db@0.0.15 install /tmp/staged/app/node_modules/ibm_db
   > node installer/driverInstall.js
   module.js:327
   throw err;
   ^
   Error: Cannot find module 'fstream'
   at Function.Module._resolveFilename (module.js:325:15)
   at Function.Module._load (module.js:276:25)
   at Module.require (module.js:353:17)
   at require (internal/module.js:12:17)
   at download_file_httpget (/tmp/staged/app/node_modules/ibm_db/installer/driverInstall.js:25:19)
   at Object.<anonymous> (/tmp/staged/app/node_modules/ibm_db/installer/driverInstall.js:340:1)
   at Module._compile (module.js:409:26)
   at Object.Module._extensions..js (module.js:416:10)
   at Module.load (module.js:343:32)
   at Function.Module._load (module.js:300:12)
   npm ERR! Linux 3.19.0-25-generic
   npm ERR! argv "/tmp/staged/app/vendor/node/bin/node" "/tmp/staged/app/vendor/node/bin/npm" "rebuild"
   npm ERR! node v4.4.3
   npm ERR! npm  v2.15.1
   npm ERR! code ELIFECYCLE
   npm ERR! ibm_db@0.0.15 install: `node installer/driverInstall.js`
   npm ERR! Exit status 1
   npm ERR!
   npm ERR! Failed at the ibm_db@0.0.15 install script 'node installer/driverInstall.js'.
   npm ERR! This is most likely a problem with the ibm_db package,
   npm ERR! not with npm itself.
   npm ERR! Tell the author that this fails on your system:
   npm ERR!     node installer/driverInstall.js
   npm ERR! You can get information on how to open an issue for this project with:
   npm ERR!     npm bugs ibm_db
   npm ERR! Or if that isn't available, you can get their info via:
   npm ERR!
   npm ERR!     npm owner ls ibm_db
   npm ERR! There is likely additional logging output above.
   npm ERR! Please include the following file with any support request:
   npm ERR!     /tmp/staged/app/npm-debug.log
-----> Build failed
4

1 回答 1

0

您必须更新才能ibm_db 0.0.18与 Node.js 一起使用4.x

根据您的日志,您正在使用 Node.js 4.4.3,因此您的package.json文件应类似于:

{
        "name": "NodejsStarterApp",
        "version": "0.0.1",
        "private": true,
        "scripts": {
                "start": "node app.js"
        },
        "dependencies": {
                "express": "4.13.x",
                "cfenv": "1.0.x",
                "ibm_db": "0.0.18"
        },
        "repository": {},
        "engines": {
                "node": "4.x"
        }
}
于 2016-05-10T12:18:21.493 回答