Open zwqco opened 1 year ago
尝试
rm -rf node_modules package-lock.json
npm install
然后运行程序看是否可以启动,如果不行继续向下尝试
npm update @swc/core ts-node
如果依然有问题,在此issues下回复
尝试
- 运行以下指令
rm -rf node_modules package-lock.json npm install
然后运行程序看是否可以启动,如果不行继续进一步尝试
- 确保你的@swc/core和ts-node都是最新版本。你可以通过运行以下命令来更新它们:
npm update @swc/core ts-node
如果仍然有问题,在此issues下回复
尝试
- 运行以下指令
rm -rf node_modules package-lock.json npm install
然后运行程序看是否可以启动,如果不行继续进一步尝试
- 确保你的@swc/core和ts-node都是最新版本。你可以通过运行以下命令来更新它们:
npm update @swc/core ts-node
如果还有问题,在此问题下回复
还是报这个错那
npx ts-node --version
查看一下ts-node的版本号
npx ts-node --version
npx ts-node --version
查看一下ts-node的版本号
是不是ts-node和 swc/core版本不匹配 大佬
看提示信息是这样的,我现在没有环境验证,可以再运行以下 npm update @swc/core ts-node 试试
npm update @swc/core ts-node
好的我再看下 谢谢
npm i @swc/core@1.3.78
由于@swc/core升级导致的一个bug,2.0.16之前需运行 npm i @swc/core@1.3.78 更新依赖,之后版本以修复此问题
PS D:\gitWorkSpace\chatflow-main> npm run start
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 ofplugins
,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