簡體   English   中英

Openshift(node.js)無法安裝jsdom

[英]Openshift (node.js) fails to install jsdom

已經使用Openshift / Node.Js一段時間了,大部分都沒有問題。 通常我安裝(通過npm)模塊到我的本地(windows)機器,開發,而不是git-deploy到Openshift,一切順利。

我最近添加了jsdom模塊(它在本地再次正常工作),但是當我git-deploy(git push沒有錯誤)時,我在嘗試使用我的應用程序時出現此錯誤:

.../app-root/runtime/repo/node_modules/jsdom/node_modules/contextify/node_modules/bindings/bindings.js:91
throw err
^
Error: Could not locate the bindings file.

接下來是Node嘗試查找的目錄列表。 當我檢查遠程服務器上的這些目錄時,它們會丟失(即使它們存在於我的本地計算機上並被推送)。 如果我嘗試通過ftp復制文件夾,我收到此錯誤:

無效的ELF標頭

我理解的是因為contextify模塊沒有在服務器上構建(即,我復制了它)。

請注意,我的package.json中的依賴項包含“jsdom”:“0.1.7”。

經過一些谷歌搜索,我接下來嘗試通過npm在遠程服務器上手動安裝模塊。 這產生了以下錯誤:

npm http 304 https://registry.npmjs.org/mime
npm http 304 https://registry.npmjs.org/combined-stream
npm http 304 https://registry.npmjs.org/async

> contextify@0.1.7 install /var/lib/openshift/52...52/nodejs/node_modules/jsdom/node_modules/contextify
> node-gyp rebuild

npm http GET https://registry.npmjs.org/assert-plus/0.1.2
npm http GET https://registry.npmjs.org/asn1/0.1.11
npm http GET https://registry.npmjs.org/ctype/0.5.2
npm http 304 https://registry.npmjs.org/ctype/0.5.2
npm http 304 https://registry.npmjs.org/assert-plus/0.1.2
npm http 304 https://registry.npmjs.org/asn1/0.1.11
Traceback (most recent call last):
  File "/opt/rh/nodejs010/root/usr/bin/gyp", line 15, in <module>
    import gyp
ImportError: No module named gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/opt/rh/nodejs010/root/usr/lib/node_modules/node-gyp/lib/configure.js:417:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:784:12)
gyp ERR! System Linux 2.6.32-431.el6oso.bz844450.x86_64
gyp ERR! command "node" "/opt/rh/nodejs010/root/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /var/lib/openshift/52...52/app-root/runtime/dependencies/nodejs/node_modules/jsdom/node_modules/contextify
gyp ERR! node -v v0.10.5
gyp ERR! node-gyp -v v0.9.5
gyp ERR! not ok

這就是我現在陷入困境的地方。 看起來遠程服務器缺少“gyp”,我不知道如何解決這個問題。 我安裝了“node-gyp”模塊,我在這里閱讀了其他npm / openshift問題 ,但不知道如何將它們應用到我的問題中。

任何幫助將不勝感激。 提前致謝!

Per Per Peat在問題評論中,Ben Parees在他鏈接的bugzilla問題上評論4,似乎OpenShift Node.js 0.10盒式磁帶在其shell路徑變量中缺少GYP的路徑。

您的一組墨盒可能無法提供GYP依賴性。 Python可能根本不可用。 我剛剛確認他們的Node.Js盒式磁帶中沒有PYTHONPATH環境變量,並且系統沒有設置為從命令行執行nmp作為用戶。

根據Redhat文檔嘗試在packages.json中聲明jsdom

如果失敗了,或者您需要更個性化的設置,比如提供自己的Python,那么答案可能是構建一個盒式磁帶。 這也是一個向上移動到節點0.12或Io.js的機會。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM