![](/img/trans.png)
[英]When I try to run this line of code in “node.js”, I am getting the following error
[英]Trying to set a hub server for togetherjs application and i am using node.js to run the server i get the following error
錯誤:在 Function.Module._resolveFilename (module.js:336:15) at Function.Module._load (module.js:286:25) at Module.require (module.js:365) 中找不到模塊“websocket-server” :17) 在對象的 require (module.js:384:17)。 (D:\\Rahul\\hubServer\\togetherjs-develop\\togetherjs-develop\\hub\\websocket-compat.js:27:28) at Module._compile (module.js:434:26) at Object.Module._extensions..js (module.js:452:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Module.require (module.js:365:17)
這意味着您尚未安裝該模塊。 要做到這一點
npm install websocket-server
通常,您將擁有一個package.json
文件,而不是手動執行此操作,您可以通過執行npm install
來安裝所有模塊
我想將 websocket-server 保存到包中,運行以下命令:
npm install websocket-server --save
請記住在您站點所在的目錄中執行npm install __
。 否則節點將找不到它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.