2017-03-09 118 views
-1

我正試圖在linux和windows上安裝javascript的quantlib。在這兩種情況下我都會遇到類似的錯誤。安裝quantlib for javascript

[[email protected] ql]$ sudo npm install quantlib 
[sudo] password for idf: 

> [email protected] 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: [email protected]^1.0.0 (node_modules/chokidar/node_modules/fsevents): 
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: 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! [email protected] postinstall: `node-pre-gyp install` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] 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 
[[email protected] ql]$ 

回答

0
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的錯誤指向一個事實,帽子npm找不到在Github上的Linux v0.2.1版本的壓縮包。看看安裝說明,它看起來像不能通過npm for linux安裝,但必須從頭開始手動完成。

0

你有沒有看錯誤消息:

https://github.com/quantlibnode/quantlibnode/releases/download/v0.2.1/linux-x64.tar.gz 

該文件根本不存在,因此沒有什麼可以做。檢查URL鏈接。

0

我是quantlib.node項目的創建者,對於遲到的回覆感到抱歉。

現在,只有Windows 32/64位預構建提供。對於Mac和Linux,您必須自己構建插件。

Mac/Linux預編譯缺失的原因是,構建過程有點複雜,在Mac/Linux上我們不能使用預編譯的quantlib,我們需要從源代碼構建它並添加某些標誌:如-std=c++11,這是節點所需的

而且我嘗試使用靜態鏈接來提升和quantlib(去除庫依賴),生成的插件非常大,200M +(在tar.gz之後)。這不便於下載。

現在,請按照steps in README.md來構建插件,您可能想要使用動態鏈接來構建它,所以生成的插件要小得多。

我會看看如果我可以使這部分更容易,請繼續關注