atorber / chatflow

一个使用wechaty构建的机器人业务管理平台
https://www.yuque.com/atorber/chatflow
Apache License 2.0
375 stars 74 forks source link

运行报错 #40

Open zwqco opened 1 year ago

zwqco commented 1 year ago

PS D:\gitWorkSpace\chatflow-main> npm run start

chatflow@2.0.16 start cross-env NODE_OPTIONS="--no-warnings --loader=ts-node/esm" node ./example/ding-dong-bot.ts

D:\gitWorkSpace\chatflow-main\node_modules\ts-node\src\transpilers\swc.ts:262 throw new Error( ^ Error: @swc/core threw an error when attempting to validate swc compiler options. You may be using an old version of swc which does not support the options used by ts-node. Try upgrading to the latest version of swc. Error message from swc: Failed to deserialize buffer as swc::config::Options JSON: {"sourceMaps":true,"module":{"noInterop":false,"type":"commonjs","strictMode":true,"ignoreDynamic":false},"swcrc":false,"jsc":{"parser":{"syntax":"typescript","tsx":false,"decorators":true,"dynamicImport":true,"importAssertions":true},"target":"es2022","transform":{"decoratorMetadata":true,"legacyDecorator":true,"react":{"throwIfNamespace":false,"useBuiltins":false}},"keepClassNames":true,"experimental":{"keepImportAssertions":true}}}

Caused by: unknown field keepImportAssertions, expected one of plugins, keepImportAttributes, emitAssertForImportAttributes, cacheRoot, disableBuiltinTransformsForInternalTesting at line 1 column 438 at createVariant (D:\gitWorkSpace\chatflow-main\node_modules\ts-node\src\transpilers\swc.ts:262:13) at createSwcOptions (D:\gitWorkSpace\chatflow-main\node_modules\ts-node\src\transpilers\swc.ts:211:25) at create (D:\gitWorkSpace\chatflow-main\node_modules\ts-node\src\transpilers\swc.ts:56:41) at createTranspiler (D:\gitWorkSpace\chatflow-main\node_modules\ts-node\src\index.ts:784:16) at createTranspileOnlyGetOutputFunction (D:\gitWorkSpace\chatflow-main\node_modules\ts-node\src\index.ts:1341:28) at createFromPreloadedConfig (D:\gitWorkSpace\chatflow-main\node_modules\ts-node\src\index.ts:1404:34) at create (D:\gitWorkSpace\chatflow-main\node_modules\ts-node\src\index.ts:624:10) at register (D:\gitWorkSpace\chatflow-main\node_modules\ts-node\src\index.ts:591:15) at Object.registerAndCreateEsmHooks (D:\gitWorkSpace\chatflow-main\node_modules\ts-node\src\esm.ts:116:34) at file:///D:/gitWorkSpace/chatflow-main/node_modules/ts-node/esm.mjs:8:7

atorber commented 1 year ago

尝试

  1. 运行以下指令
rm -rf node_modules package-lock.json
npm install

然后运行程序看是否可以启动,如果不行继续向下尝试

  1. 确保你的@swc/core和ts-node都是最新版本。你可以通过运行以下命令来更新它们:
npm update @swc/core ts-node

如果依然有问题,在此issues下回复

zwqco commented 1 year ago

尝试

  1. 运行以下指令
rm -rf node_modules package-lock.json
npm install

然后运行程序看是否可以启动,如果不行继续进一步尝试

  1. 确保你的@swc/core和ts-node都是最新版本。你可以通过运行以下命令来更新它们:
npm update @swc/core ts-node

如果仍然有问题,在此issues下回复

尝试

  1. 运行以下指令
rm -rf node_modules package-lock.json
npm install

然后运行程序看是否可以启动,如果不行继续进一步尝试

  1. 确保你的@swc/core和ts-node都是最新版本。你可以通过运行以下命令来更新它们:
npm update @swc/core ts-node

如果还有问题,在此问题下回复

还是报这个错那

atorber commented 1 year ago

npx ts-node --version

查看一下ts-node的版本号

zwqco commented 1 year ago

npx ts-node --version

image

zwqco commented 1 year ago

npx ts-node --version

查看一下ts-node的版本号

是不是ts-node和 swc/core版本不匹配 大佬

atorber commented 1 year ago

看提示信息是这样的,我现在没有环境验证,可以再运行以下 npm update @swc/core ts-node 试试

zwqco commented 1 year ago

npm update @swc/core ts-node

好的我再看下 谢谢

atorber commented 1 year ago

npm i @swc/core@1.3.78

atorber commented 1 year ago

由于@swc/core升级导致的一个bug,2.0.16之前需运行 npm i @swc/core@1.3.78 更新依赖,之后版本以修复此问题