egg-socket.io start error “Cannot convert undefined or null to object”
See original GitHub issue- Node Version:
- Egg Version:
- Plugin Name:
- Plugin Version:
- Platform:
- Mini Showcase Repository:
我按照egg-socket.io项目中README的步骤,用npm并配置了这个插件,但是在npm run dev
的时候一直报如下错误:
/root/projects/agent-server/node_modules/_egg@1.3.0@egg/lib/application.js:38
throw e;
^
TypeError: Cannot convert undefined or null to object
at Namespace.use (/root/projects/agent-server/node_modules/_socket.io@2.0.2@socket.io/lib/namespace.js:103:21)
at initNsp (/root/projects/agent-server/node_modules/_egg-socket.io@2.0.0@egg-socket.io/lib/io.js:80:9)
at module.exports.app (/root/projects/agent-server/node_modules/_egg-socket.io@2.0.0@egg-socket.io/lib/io.js:55:5)
at AppWorkerLoader.loadFile (/root/projects/agent-server/node_modules/_egg-core@3.7.0@egg-core/lib/loader/egg_loader.js:270:34)
at getLoadUnits.forEach.unit (/root/projects/agent-server/node_modules/_egg-core@3.7.0@egg-core/lib/loader/mixin/custom.js:25:29)
at Array.forEach (native)
at AppWorkerLoader.loadCustomApp (/root/projects/agent-server/node_modules/_egg-core@3.7.0@egg-core/lib/loader/mixin/custom.js:25:8)
at AppWorkerLoader.load (/root/projects/agent-server/node_modules/_egg@1.3.0@egg/lib/loader/app_worker_loader.js:33:10)
at new Application (/root/projects/agent-server/node_modules/_egg@1.3.0@egg/lib/application.js:34:19)
at Object.<anonymous> (/root/projects/agent-server/node_modules/_egg-cluster@1.6.2@egg-cluster/lib/app_worker.js:12:13)
这是什么原因呢? node版本是6.10.2 npm版本3.10.10 egg-socket.io是直接用npm安装的(也用cnpm安装过,一样的错误)
Issue Analytics
- State:
- Created 6 years ago
- Comments:23 (14 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
我在搞了,马上发
已经找到问题了~~ egg-socket.io 2.0.0的原因,退回 egg-socket.io 1.2.2就好了,和egg版本 无关