VSCode中运行Moralis-Server执行npm run moralis:sync命令时遭遇frpc未识别错误
frpc Not Recognized Error When Running npm run moralis:sync Hey there, let’s get this sorted out—your error clearly points to the frpc executable not being found by Windows, which boils down to common cross-platform file naming and path gotchas.
First, let’s recap the error you’re hitting to align on the issue:
my-app@0.1.0 moralis:sync moralis-admin-cli connect-local-devchain --chain hardhat --moralisSubdomain cxdjddn5lxdh.usemoralis.com --frpcPath ./frp/frpc Starting connection to Hardhat exec error: Error: Command failed: "./frp/frpc" http -s cxdjddn5lxdh.usemoralis.com:7000 -t GCqiUSu6wG -l 8545 -d cxdjddn5lxdh.usemoralis.com '"./frp/frpc"' is not recognized as an internal or external command, operable program or batch file.
Root Cause
Windows requires executable files to have a .exe suffix, but your command references ./frp/frpc (no suffix). You also need to confirm you downloaded the Windows-specific frp build—Linux/macOS frp executables won’t work on Windows.
Step-by-Step Fixes
Verify frpc.exe exists in your frp folder
Navigate to the./frpdirectory in your project. You should see a file namedfrpc.exe(not justfrpc). If it’s missing, grab the correct Windows frp build (look for the Windows-specific zip from frp’s official releases).Update your package.json script to include the .exe suffix
Open yourpackage.jsonfile, find themoralis:syncscript, and modify the--frpcPathvalue to add the.exeextension:"scripts": { "moralis:sync": "moralis-admin-cli connect-local-devchain --chain hardhat --moralisSubdomain cxdjddn5lxdh.usemoralis.com --frpcPath ./frp/frpc.exe" }Test the frpc command manually first (optional but helpful)
Open Command Prompt or PowerShell, navigate to your project root, and run this command directly to confirm it works:./frp/frpc.exe http -s cxdjddn5lxdh.usemoralis.com:7000 -t GCqiUSu6wG -l 8545 -d cxdjddn5lxdh.usemoralis.comIf this runs without errors, your
npm run moralis:syncshould work too.Fix path issues (if manual test fails)
If you still get a "file not found" error, try using the full absolute path tofrpc.exe(e.g.,C:\Users\YourName\Projects\my-app\frp\frpc.exe) in both the manual command and package.json script.
Bonus: For WSL Users
If you’re running this in Windows Subsystem for Linux, make sure you’re using the Linux frp build (no .exe suffix) and grant executable permissions:
chmod +x ./frp/frpc
内容的提问来源于stack exchange,提问作者Abed ja'fari

