gpt4 book ai didi

node.js - 错误: Cannot find module 'socket.io' when I am making git push

转载 作者:太空宇宙 更新时间:2023-11-04 00:48:39 25 4
gpt4 key购买 nike

我一直在尝试使用以下行将项目上传到 dokku 服务器。

git推送dokku大师

因此,当项目开始上传时出现此错误:

-----> 运行飞行前检查

   For more efficient zero downtime deployments, create a file CHECKS.

See http://progrium.viewdocs.io/dokku/checks-examples.md for examples

CHECKS file not found in container: Running simple container check...

----->等待10秒...

远程:应用程序容器启动失败!!

====> 聊天容器输出:

   > @ start /app
> node ./doc/node_servers/cobrowsing/server.js
module.js:339
throw err;
^

Error: Cannot find module '/usr/local/lib/node_modules/socket.io'
at Function.Module._resolveFilename (module.js:337:15)
at Function.Module._load (module.js:287:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.<anonymous> (/app/doc/node_servers/cobrowsing/server.js:4:10)
at Module._compile (module.js:425:26)
at Object.Module._extensions..js (module.js:432:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Function.Module.runMain (module.js:457:10)
npm ERR! Linux 3.13.0-57-generic
npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
npm ERR! node v5.0.0

npm ERR! npm v3.3.6
npm ERR! code ELIFECYCLE
npm ERR! @ start: `node ./doc/node_servers/cobrowsing/server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ start script 'node ./doc/node_servers/cobrowsing/server.js'.
npm ERR! This is most likely a problem with the package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./doc/node_servers/cobrowsing/server.js
npm ERR! You can get their info via:
npm ERR! npm owner ls
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /app/npm-debug.log

=====>结束聊天容器输出

远程:来自守护程序的错误响应:无法终止容器

244766ea68169dfaabcad927484efa546a5c9e7ba100845183a7595120c7668f:容器

244766ea68169dfaabcad927484efa546a5c9e7ba100845183a7595120c7668f 未运行

远程:错误:无法终止容器:

[244766ea68169dfaabcad927484efa546a5c9e7ba100845183a7595120c7668f]

发送至 dokku@website.com:聊天

! [远程拒绝] master -> master(预接收 Hook 被拒绝)

我该如何解决此问题并上传项目?

最佳答案

检查您的 package.json 文件。

使用

npm install socket.io --save 

在项目文件夹中保存package.json上的依赖项。 :)

@编辑

作者:'我解决了,我必须删除文件夹“node_modules”,然后 npm install'

关于node.js - 错误: Cannot find module 'socket.io' when I am making git push,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33523412/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com