为 javascript 安装 quantlib
Installing quantlib for javascript
我正在尝试在 linux 和 windows 上为 javascript
安装 quantlib。我在这两种情况下都遇到了类似的错误。
[idf@node3 ql]$ sudo npm install quantlib
[sudo] password for idf:
> quantlib@0.2.1 postinstall /home/idf/Documents/js/node_modules/quantlib
> node-pre-gyp install
node-pre-gyp ERR! install error
node-pre-gyp ERR! stack Error: 404 status code downloading tarball https://github.com/quantlibnode/quantlibnode/releases/download/v0.2.1/linux-x64.tar.gz
node-pre-gyp ERR! stack at Request.<anonymous> (/home/idf/Documents/js/node_modules/node-pre-gyp/lib/install.js:120:27)
node-pre-gyp ERR! stack at emitOne (events.js:101:20)
node-pre-gyp ERR! stack at Request.emit (events.js:188:7)
node-pre-gyp ERR! stack at Request.onRequestResponse (/home/idf/Documents/js/node_modules/request/request.js:1029:10)
node-pre-gyp ERR! stack at emitOne (events.js:96:13)
node-pre-gyp ERR! stack at ClientRequest.emit (events.js:188:7)
node-pre-gyp ERR! stack at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:474:21)
node-pre-gyp ERR! stack at HTTPParser.parserOnHeadersComplete (_http_common.js:99:23)
node-pre-gyp ERR! stack at TLSSocket.socketOnData (_http_client.js:363:20)
node-pre-gyp ERR! stack at emitOne (events.js:96:13)
node-pre-gyp ERR! System Linux 3.10.0-229.1.2.el7.x86_64
node-pre-gyp ERR! command "/usr/bin/node" "/home/idf/Documents/js/node_modules/.bin/node-pre-gyp" "install"
node-pre-gyp ERR! cwd /home/idf/Documents/js/node_modules/quantlib
node-pre-gyp ERR! node -v v6.9.4
node-pre-gyp ERR! node-pre-gyp -v v0.6.33
node-pre-gyp ERR! not ok
404 status code downloading tarball https://github.com/quantlibnode/quantlibnode/releases/download/v0.2.1/linux-x64.tar.gz
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN enoent ENOENT: no such file or directory, open '/home/idf/Documents/js/package.json'
npm WARN js No description
npm WARN js No repository field.
npm WARN js No README data
npm WARN js No license field.
npm ERR! Linux 3.10.0-229.1.2.el7.x86_64
npm ERR! argv "/usr/bin/node" "/bin/npm" "install" "quantlib"
npm ERR! node v6.9.4
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! quantlib@0.2.1 postinstall: `node-pre-gyp install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the quantlib@0.2.1 postinstall script 'node-pre-gyp install'.
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 quantlib package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs quantlib
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls quantlib
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/idf/Documents/js/ql/npm-debug.log
[idf@node3 ql]$
您是否满足以下要求:
enter link description here
node-pre-gyp ERR! stack Error: 404 status code downloading tarball https://github.com/quantlibnode/quantlibnode/releases/download/v0.2.1/linux-x64.tar.gz
Linux 错误表明 hat npm
无法在 Github 中找到 Linux 的 v0.2.1 tarball 版本。看了一下安装说明,似乎无法通过 npm
for linux 安装,必须手动从头开始安装。
你看过错误信息了吗:
https://github.com/quantlibnode/quantlibnode/releases/download/v0.2.1/linux-x64.tar.gz
文件根本不存在,因此无能为力。检查 URL link.
我是 quantlib.node 项目的创建者,很抱歉回复晚了。
目前,仅提供 windows 32/64 位预构建。对于 Mac 和 Linux,您必须自己构建插件。
缺少Mac/Linux预构建的原因是,构建过程有点复杂,Mac/Linux我们不能使用预构建quantlib,我们需要从来源并添加某些标志:如-std=c++11
,这是节点
所需要的
我确实尝试使用静态链接来提升和 quantlib(以删除库依赖),生成的插件非常大,200M+(在 tar.gz 之后)。这个不方便下载。
现在,请按照steps in README.md构建插件,您可能希望使用动态链接构建它,因此生成的插件要小得多。
我会看看能不能让这部分更简单,敬请期待
您现在可以试试 quantlib.js,它是纯粹的 javascript,可以在 node.js 和浏览器中使用
我正在尝试在 linux 和 windows 上为 javascript
安装 quantlib。我在这两种情况下都遇到了类似的错误。
[idf@node3 ql]$ sudo npm install quantlib
[sudo] password for idf:
> quantlib@0.2.1 postinstall /home/idf/Documents/js/node_modules/quantlib
> node-pre-gyp install
node-pre-gyp ERR! install error
node-pre-gyp ERR! stack Error: 404 status code downloading tarball https://github.com/quantlibnode/quantlibnode/releases/download/v0.2.1/linux-x64.tar.gz
node-pre-gyp ERR! stack at Request.<anonymous> (/home/idf/Documents/js/node_modules/node-pre-gyp/lib/install.js:120:27)
node-pre-gyp ERR! stack at emitOne (events.js:101:20)
node-pre-gyp ERR! stack at Request.emit (events.js:188:7)
node-pre-gyp ERR! stack at Request.onRequestResponse (/home/idf/Documents/js/node_modules/request/request.js:1029:10)
node-pre-gyp ERR! stack at emitOne (events.js:96:13)
node-pre-gyp ERR! stack at ClientRequest.emit (events.js:188:7)
node-pre-gyp ERR! stack at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:474:21)
node-pre-gyp ERR! stack at HTTPParser.parserOnHeadersComplete (_http_common.js:99:23)
node-pre-gyp ERR! stack at TLSSocket.socketOnData (_http_client.js:363:20)
node-pre-gyp ERR! stack at emitOne (events.js:96:13)
node-pre-gyp ERR! System Linux 3.10.0-229.1.2.el7.x86_64
node-pre-gyp ERR! command "/usr/bin/node" "/home/idf/Documents/js/node_modules/.bin/node-pre-gyp" "install"
node-pre-gyp ERR! cwd /home/idf/Documents/js/node_modules/quantlib
node-pre-gyp ERR! node -v v6.9.4
node-pre-gyp ERR! node-pre-gyp -v v0.6.33
node-pre-gyp ERR! not ok
404 status code downloading tarball https://github.com/quantlibnode/quantlibnode/releases/download/v0.2.1/linux-x64.tar.gz
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN enoent ENOENT: no such file or directory, open '/home/idf/Documents/js/package.json'
npm WARN js No description
npm WARN js No repository field.
npm WARN js No README data
npm WARN js No license field.
npm ERR! Linux 3.10.0-229.1.2.el7.x86_64
npm ERR! argv "/usr/bin/node" "/bin/npm" "install" "quantlib"
npm ERR! node v6.9.4
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! quantlib@0.2.1 postinstall: `node-pre-gyp install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the quantlib@0.2.1 postinstall script 'node-pre-gyp install'.
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 quantlib package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs quantlib
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls quantlib
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/idf/Documents/js/ql/npm-debug.log
[idf@node3 ql]$
您是否满足以下要求: enter link description here
node-pre-gyp ERR! stack Error: 404 status code downloading tarball https://github.com/quantlibnode/quantlibnode/releases/download/v0.2.1/linux-x64.tar.gz
Linux 错误表明 hat npm
无法在 Github 中找到 Linux 的 v0.2.1 tarball 版本。看了一下安装说明,似乎无法通过 npm
for linux 安装,必须手动从头开始安装。
你看过错误信息了吗:
https://github.com/quantlibnode/quantlibnode/releases/download/v0.2.1/linux-x64.tar.gz
文件根本不存在,因此无能为力。检查 URL link.
我是 quantlib.node 项目的创建者,很抱歉回复晚了。
目前,仅提供 windows 32/64 位预构建。对于 Mac 和 Linux,您必须自己构建插件。
缺少Mac/Linux预构建的原因是,构建过程有点复杂,Mac/Linux我们不能使用预构建quantlib,我们需要从来源并添加某些标志:如-std=c++11
,这是节点
我确实尝试使用静态链接来提升和 quantlib(以删除库依赖),生成的插件非常大,200M+(在 tar.gz 之后)。这个不方便下载。
现在,请按照steps in README.md构建插件,您可能希望使用动态链接构建它,因此生成的插件要小得多。
我会看看能不能让这部分更简单,敬请期待
您现在可以试试 quantlib.js,它是纯粹的 javascript,可以在 node.js 和浏览器中使用