cloudfreexiao / skynet-cocos-creator

skynet cocoscreator puremvc
51 stars 17 forks source link

cocos2.2.1无法打开此工程,会报以下错误 #1

Open guozanhua opened 4 years ago

guozanhua commented 4 years ago

Failed to load package at D:\work\gameframework\skynet-cocos-creator-client\packages\i18n: Failed to load main.js: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined Failed to load package at D:\work\gameframework\skynet-cocos-creator-client\packages\i18n: Failed to load main.js: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined load script [protobufjs] failed : Error: Cannot find module 'protobufjs'

load script [isomorphic-fetch] failed : Error: Cannot find module 'isomorphic-fetch' load script [../../../../packages/i18n/runtime-scripts/LanguageData] failed : Error: Cannot find module '../../../../packages/i18n/runtime-scripts/LanguageData'

cloudfreexiao commented 4 years ago

没安装依赖

guozanhua commented 4 years ago

没安装依赖

Failed to load package at D:\work\gameframework\skynet-cocos-creator-client\packages\i18n: Failed to load main.js: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined at validateString (internal/validators.js:105:11) at Object.join (path.js:372:7) at Object. (D:\work\gameframework\skynet-cocos-creator-client\packages\i18n\utils\package.js:6:17) at Module._compile (internal/modules/cjs/loader.js:839:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:851:10) at Module.load (internal/modules/cjs/loader.js:701:32) at tryModuleLoad (internal/modules/cjs/loader.js:633:12) at Function.Module._load (internal/modules/cjs/loader.js:625:3) at Module.require (internal/modules/cjs/loader.js:739:19) at require (internal/modules/cjs/helpers.js:14:16) Cocos Service load base data!

在根目录下执行了npm install 之后,protobuf的依赖问题好了,但是i18n的Failed to load main.js依然存在

cloudfreexiao commented 4 years ago

从报错看 路径 有问题 我🤕️没环境 不好意思查不了

guozanhua commented 4 years ago

从报错看 路径 有问题 我🤕️没环境 不好意思查不了

你那边的测试环境是cocos creator的什么版本,我用的cocos creator的2.2.1,应该是i18n的扩展没有安装成功,你有测试过这个i18n,在cocos creator 2.2.1的版本下安装运行不?

guozanhua commented 4 years ago

从报错看 路径 有问题 我🤕️没环境 不好意思查不了

你那边的测试环境是cocos creator的什么版本,我用的cocos creator的2.2.1,应该是i18n的扩展没有安装成功,你有测试过这个i18n,在cocos creator 2.2.1的版本下安装运行不?

======================================= load script [../../../../packages/i18n/runtime-scripts/LanguageData] failed : Error: Cannot find module '../../../../packages/i18n/runtime-scripts/LanguageData' Require stack:

guozanhua commented 4 years ago

============================================= [../../../../packages/i18n/runtime-scripts/LanguageData] failed : Error: Cannot find module '../../../../packages/i18n/runtime-scripts/LanguageData'

根据版本的路径,我调整了相对路径的层次,可以正确加载LanguageData,但是运行的时候报以下错误:

Can not find deps [buffer] for path : preview-scripts/node_modules/@protobufjs/inquire/index.js modular.js:50 Can not find deps [long] for path : preview-scripts/__node_modules/@protobufjs/inquire/index.js modular.js:50 Can not find deps [fs] for path : preview-scripts/node_modules/@protobufjs/inquire/index.js modular.js:50 Can not find deps [fs] for path : preview-scripts/__node_modules/@protobufjs/inquire/index.js modular.js:50 Can not find deps [../decorators] for path : preview-scripts/assets/script/lib/behavior3/core/BehaviorTree.js modular.js:50 Can not find deps [./constants] for path : preview-scripts/assets/script/lib/behavior3/index.js modular.js:50 Can not find deps [./b3.functions] for path : preview-scripts/assets/script/lib/behavior3/index.js modular.js:50 Can not find deps [./actions/Error] for path : preview-scripts/assets/script/lib/behavior3/index.js modular.js:50 Can not find deps [./actions/Failer] for path : preview-scripts/assets/script/lib/behavior3/index.js modular.js:50 Can not find deps [./actions/Runner] for path : preview-scripts/assets/script/lib/behavior3/index.js modular.js:50 Can not find deps [./actions/Succeeder] for path : preview-scripts/assets/script/lib/behavior3/index.js modular.js:50 Can not find deps [./actions/Wait] for path : preview-scripts/assets/script/lib/behavior3/index.js modular.js:50 Can not find deps [./composites/MemPriority] for path : preview-scripts/assets/script/lib/behavior3/index.js modular.js:50 Can not find deps [./composites/MemSequence] for path : preview-scripts/assets/script/lib/behavior3/index.js modular.js:50 Can not find deps [./composites/Priority] for path : preview-scripts/assets/script/lib/behavior3/index.js modular.js:50 Can not find deps [./composites/Sequence] for path : preview-scripts/assets/script/lib/behavior3/index.js modular.js:50 Can not find deps [./core/Action] for path : preview-scripts/assets/script/lib/behavior3/index.js modular.js:50 Can not find deps [./core/BaseNode] for path : preview-scripts/assets/script/lib/behavior3/index.js

Can not find deps [./core/BehaviorTree] for path : preview-scripts/assets/script/lib/behavior3/index.js modular.js:50 Can not find deps [./core/Blackboard] for path : preview-scripts/assets/script/lib/behavior3/index.js modular.js:50 Can not find deps [./core/Composite] for path : preview-scripts/assets/script/lib/behavior3/index.js modular.js:50 Can not find deps [./core/Condition] for path : preview-scripts/assets/script/lib/behavior3/index.js modular.js:50 Can not find deps [./core/Decorator] for path : preview-scripts/assets/script/lib/behavior3/index.js modular.js:50 Can not find deps [./core/Tick] for path : preview-scripts/assets/script/lib/behavior3/index.js modular.js:50 Can not find deps [./decorators/Inverter] for path : preview-scripts/assets/script/lib/behavior3/index.js modular.js:50 Can not find deps [./decorators/Limiter] for path : preview-scripts/assets/script/lib/behavior3/index.js modular.js:50 Can not find deps [./decorators/MaxTime] for path : preview-scripts/assets/script/lib/behavior3/index.js modular.js:50 Can not find deps [./decorators/RepeatUntilFailure] for path : preview-scripts/assets/script/lib/behavior3/index.js Can not find deps [./decorators/RepeatUntilSuccess] for path : preview-scripts/assets/script/lib/behavior3/index.js modular.js:50 Can not find deps [./decorators/Repeater] for path : preview-scripts/assets/script/lib/behavior3/index.js

=========================================================== 这个是我什么依赖没有安装吗

cloudfreexiao commented 4 years ago

你把 behavior3 删了 试试

guozanhua commented 4 years ago

你把 behavior3 删了 试试

删除掉behavior3,可以跑了,兄弟看看这个behavior3问题,能否整合进来,行为树是个好东西,另外这个客户端对接的是RillServer还是AntServer?

cloudfreexiao commented 4 years ago

这个的 协议格式 是而外一套 (与skynet交互是 先http验证然后拿到 ws 相关所需的信息 再以 rpcId(大端4字节) + body 形式的数据结构)

guozanhua commented 4 years ago

就是说这个cocos客户端的项目和我们RillServer和AntServer都不能对接,需要自己定制修改,是吗

guozanhua commented 4 years ago

有一个简单的例子参考一下吗