swordjs / sword-framework

A small and flexible for serverless nodejs framework 💗
25 stars 3 forks source link

Mac 运行错误 #13

Closed linyu520 closed 1 year ago

linyu520 commented 2 years ago

node版本:v16.16.0 sword-framework-cli版本:1.5.5-alpha.4 Hbuilder X版本:3.5.3

问题:cli创建项目并且pnpm i后,按文档运行dev:unicloud报错 no such file or directory, open '/Applications/HBuilderX.app/Contents/HBuilderX/plugins/unicloud/manager/src/api.json' 已经在sword.config.ts配置过link,并且uniappa项目里index.js配置好exports.main = require("./sword/src/index.js");

seho-dev commented 2 years ago

这个问题我还遇到过, 我回去复现一下

seho-dev commented 2 years ago

升级一下framework程序1.4.1-alpha.1试一下

linyu520 commented 2 years ago

dev环境下快捷使用_add创建API,报错 no such file or directory, open '/Users/toybaba/Desktop/多商户管理系统admin/src/api/_add/proto.ts'] { errno: -2, code: 'ENOENT', syscall: 'open', path: '/Users/toybaba/Desktop/多商户管理系统admin/src/api/_add/proto.ts' }

linyu520 commented 2 years ago

npm run build:unicloud打包后,在HbuilderX里运行本地云函数报错 Cannot find module '@swordjs/sword-framework'

seho-dev commented 2 years ago

首先你要知道unicloud的原理, 既然是prod生产, 你就应该上传云函数, 而不是本地执行, 如果你要本地执行就得npm install; 云函数在云上也是要安装依赖的, 所以你试试上传并且运行云函数

seho-dev commented 2 years ago

dev环境下快捷使用_add创建API,报错 no such file or directory, open '/Users/toybaba/Desktop/多商户管理系统admin/src/api/_add/proto.ts'] { errno: -2, code: 'ENOENT', syscall: 'open', path: '/Users/toybaba/Desktop/多商户管理系统admin/src/api/_add/proto.ts' }

我这里应该没有复现, 我晚上回去试试, 是mac么, 我之前测试过, 是可以的

linyu520 commented 2 years ago

还是一样Mac

seho-dev commented 2 years ago

我在公司没办法试, 我回家看看, 你可以提pr么

seho-dev commented 2 years ago

我windows support还没做完, windows我远程调试太痛苦了