Comments (15)
admin和robot毕竟是工具,项目还是纯净些好。想用admin和robot手动弄一下就行了。
from pinus.
这个可以有,后续可以把cli的功能做强大点,让这两个变成可选项。毕竟现在已经是插件模式。
from pinus.
这个是基于Pomelo的那个版本开发的?
from pinus.
@zengqingsong
yes. pinus 是TS版的 pomelo.并且修复了一些bug,做了一些优化
from pinus.
各位大佬,我是新手一个,想问一下,怎么添加admin-server,和robot-server??
from pinus.
@didoupeanut
直接看pomelo的文档。。
from pinus.
我把pinus项目中的robot-example 项目独立出来,一编译就报错:
报错信息:
node_modules/pinus-robot/lib/agent/agent.ts:1:17 - error TS2503: Cannot find namespace 'SocketIOClient'.
1 import Socket = SocketIOClient.Socket;
我把example中的websocket-chat 独立出来,也是报错,两者的共同点都是引用了pinus-robot 和pinus-robot-plugn.
这个有大佬帮忙解释一下嘛?
我把引用注释掉就不会有编译问题了
from pinus.
@didoupeanut
目前版本 1.4.10 没有遇到你说的问题
from pinus.
两个插件都是1.4.9,我看看1.4.10有没有这个问题
from pinus.
1.4.10还是有问题。vscode控制台打印:
PS E:\pinus\chat\server-game> npm run build
[email protected] build E:\pinus\chat\server-game
tsc && node copy
node_modules/pinus-robot/lib/agent/agent.ts:1:17 - error TS2503: Cannot find namespace 'SocketIOClient'.
1 import Socket = SocketIOClient.Socket;
~~~~~~~~~~~~~~
Found 1 error.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: tsc && node copy
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2020-08-27T08_54_14_012Z-debug.log
工程配置:
{
"name": "pinus",
"version": "0.0.1",
"private": false,
"bin": {
"$": "./dist/bin/app.js"
},
"main": "./dist/app",
"scripts": {
"start": "npm run build && cd dist && node app",
"build": "node_modules/.bin/tsc && node copy"
},
"dependencies": {
"@types/node": "8.10.54",
"@types/bluebird": "^3.5.19",
"pinus": "1.4.10",
"pinus-robot": "^1.4.10",
"pinus-robot-plugin": "^1.4.10",
"bluebird": "^3.5.1",
"source-map-support": "^0.5.0",
"reflect-metadata": "^0.1.10"
},
"devDependencies": {
"cpy": "^8.1.0",
"tslint": "5.20.1",
"typescript": "3.7.3"
}
}
ts配置文件我没改:
{
"compilerOptions": {
// types option has been previously configured
"types": [
// add node as an option
"node"
],
"module": "commonjs", //指定生成哪个模块系统代码
"target": "es2017",
"lib": [
"es2015",
"es2016",
"es2017",
"esnext.asynciterable"
],
"noImplicitAny": false, //在表达式和声明上有隐含的'any'类型时报错。
"noImplicitThis": false,
"inlineSourceMap": true,
"rootDirs": [
"."
], //仅用来控制输出的目录结构--outDir。
"outDir": "./dist", //重定向输出目录。
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"moduleResolution": "node",
"watch": false //在监视模式下运行编译器。会监视输出文件,在它们改变时重新编译。
},
"include": [
".//*.ts", "copy.js"
],
"exclude": [
"./dist//."
]
}
我只是释放了app.ts的注释:
import { pinus } from 'pinus';
import * as routeUtil from './app/util/routeUtil';
import { preload } from './preload';
// 就是这行引用,导致ts编译报错,不知道为什么我这里编译会检查依赖,加上了"skipLibCheck": true, 也没用
import { createRobotPlugin } from 'pinus-robot-plugin';
// 原来的代码。。。
// if (app.isMaster()) {
// app.use(createRobotPlugin({ scriptFile: __dirname + '/robot/robot.js' }));
// }
// start app
app.start();
from pinus.
npm install @types/socket.io-client
试一下
from pinus.
可以了,给工程加上这个依赖就可以用robot插件了,
from pinus.
我检查了一下,@types/socket.io-client 这个依赖是在pinus-rpc中添加的,但是在robot插件中没有,pinus中也没有,所以如果没有加上pinus-rpc依赖就会有问题,所以这个是不是考虑加到pinus中呢?或者创建项目的时候给加上? @whtiehack
from pinus.
pinus-robot 有这个依赖的.不知道为什么你那会报错.
from pinus.
node_modules/pinus-robot/lib/agent/agent.ts:1:17 - error TS2503: Cannot find namespace 'SocketIOClient'.
1 import Socket = SocketIOClient.Socket;
~~~~~~~~~~~~~~
我用npm中下载的pinus-example-robot, 直接运行dist 可以,但是重新编译ts脚本 就报这个错,是怎么回事呢
from pinus.
Related Issues (20)
- 示例工程中运执行npm-install.bat报错怎么处理 HOT 3
- pinus-admin-web不能正常显示监控数据 HOT 4
- 解决一下严格模式问题
- protobuf支持map吗? HOT 11
- 请问指南中完整的mmo游戏demo在哪里 HOT 1
- pinus-robot 启动master节点连接报错 {"code":5,"message":"Unsupported protocol version"} HOT 2
- [pinus-admin] pinus-admin客户端connect问题。 HOT 2
- 请问下如何服务器和客户端之间的消息如何启用 compressGzip 进行压缩 HOT 2
- 有人了解colyseus这个游戏框架吗?有跟pinus对比过吗
- pinus-logger模块打印对象时,显示[object object]的问题 HOT 4
- 客户端build.js和服务器怎么感觉没有适配好? HOT 4
- 有没遇到过这种情况?master请求其他实例失败,下面是报错日志,有新的connector服务加入,通知其他connector好像失败了 HOT 2
- 其他服务与master断开连接后,会触发master不断的重连,这个重连好像不会停止,还是说有什么地方可以配置 HOT 4
- connector性能瓶颈 HOT 8
- jsclient-websocket, request的第128个请求得不到返回 HOT 1
- app.rpcInvoke is not a function HOT 1
- 启动不了,报错 (`node:stream/web`) HOT 4
- 快速入门有些操作会报错,不知nodejs版本要求多少 10.x,14.x,20.x都试过 HOT 3
- npm 上的版本太老了,能不能发个最新版 HOT 2
- 关于业务逻辑的热更思考 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pinus.