External Adapter仓库开箱运行时抛出语法错误
Hey there, let's break down what's going on here and get this fixed:
That error is happening because your current Node.js version doesn't support the optional chaining operator (?.)—this syntax was officially added in Node.js 14.0.0, and your environment is running an older version that can't parse it. The core modules of the external-adapters-js repo (like the packages/core/bootstrap module throwing the error) use this syntax across all adapters, which is why every one you try to run hits the same issue.
Here's your step-by-step solution:
Check your current Node.js version
Run this in your terminal to confirm what version you're using:node -vIf the output is anything below
v14.0.0, that's exactly the root cause.Upgrade Node.js (using nvm is the easiest way)
nvm (Node Version Manager) lets you switch between Node versions without messing up your system setup:- If you don't have nvm installed yet, you can install it via your system's package manager (like Homebrew for Mac, apt for Debian/Ubuntu, etc.) or follow the official installation steps.
- Install the latest LTS (Long-Term Support) version of Node.js—this is the most stable option for production use:
nvm install --lts - Switch to the newly installed LTS version:
nvm use --lts
Verify the upgrade worked
Runnode -vagain—you should see a version number starting withv14or higher.Restart your adapter
Head back to the Coingecko adapter directory (or any other adapter you want to run) and re-run the start command:cd packages/sources/coingecko && yarn start
This should resolve the syntax error immediately, since your Node.js environment will now understand the optional chaining operator used throughout the repo's core code.
内容的提问来源于stack exchange,提问作者julian

