簡體   English   中英

嘗試獲取openshift / nodejs上已安裝模塊的列表時出錯

[英]Errors on trying to get a list of installed modules on openshift/nodejs

嘗試設置一個使用openshift托管的簡單節點應用程序-使用restify和mongojs模塊。 我對應用程序所做的唯一更改是添加

"restify": "latest",
"mongojs": "latest"

到package.json中的dependencies部分,然后進行git push。

由於我也想設置本地開發/測試環境,因此請使用http://openshift.github.io/documentation/oo_cartridge_guide.html#local-development-testing提供的文檔

如文檔中所述-如果我運行

ssh <uid>@<appname>.rhcloud.com npm list -g

我得到一長串以結尾的錯誤

npm WARN unmet dependency /opt/rh/nodejs010/root/usr/lib/node_modules/ws requires options@'latest' but will load 
npm WARN unmet dependency /opt/rh/nodejs010/root/usr/lib/node_modules/options, 
npm WARN unmet dependency which is version 0.0.5 
npm ERR! missing: npm@*, required by undefined@undefined 
npm ERR! missing: openshift-node-web-proxy@*, required by undefined@undefined 
npm ERR! invalid: options@0.0.5 /opt/rh/nodejs010/root/usr/lib/node_modules/options 
npm ERR! not ok code 0

錯誤正文包含很多錯誤,例如...

glob error { [Error: EACCES, readdir '/opt/rh/nodejs010/root/usr/lib/node_modules/npm/man/man3/whoami.3']
  errno: 3,
  code: 'EACCES',
  path: '/opt/rh/nodejs010/root/usr/lib/node_modules/npm/man/man3/whoami.3' }
glob error { [Error: EACCES, readdir '/opt/rh/nodejs010/root/usr/lib/node_modules/npm/man/man3/whoami.3']
  errno: 3,
  code: 'EACCES',
  path: '/opt/rh/nodejs010/root/usr/lib/node_modules/npm/man/man3/whoami.3' }

建議采取的措施是什么? 如何解決這些錯誤? 應用程序是否處於損壞狀態?

在Openshift上,您不能不全局安裝內容。

改用本地模塊,如果需要運行可執行文件(例如coffee,mocha,grunt ...),請從node_modules\\.bin文件夾中啟動它們。

-編輯-

官方文檔中所述,可以在全局范圍內安裝內容,但不建議這樣做。 我想你應該有足夠的權利。

不過,更好的選擇是將它們安裝在本地計算機/工作站上當前登錄用戶的主目錄中。

如果您確實需要全局上的東西,請考慮將它們放進購物車:在不同的VM上擴展時,它將更加方便

暫無
暫無

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

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