Windows 10系统下安装AWS Amplify CLI失败求助
Let's break down each issue you're facing and walk through actionable fixes to get the Amplify CLI installed successfully:
1. npm WARN deprecated fsevents@1.2.9: One of your dependencies needs to upgrade to fsevents v2
This warning is harmless and can be safely ignored.
fsevents is a macOS-specific package for handling file system events—it doesn't run or install on Windows. The warning pops up because some of Amplify CLI's dependencies include cross-platform configuration that references fsevents, but the package won't actually be downloaded or used on your Windows machine. No action is needed here.
2. npm WARN relay-compiler@6.0.0 requires a peer of graphql@^14.2.0 but none is installed. You must install peer dependencies yourself
This is a peer dependency warning from a sub-package (relay-compiler) pulled in by Amplify CLI.
While you could manually install the required graphql version with npm install -g graphql@14.2.0, this isn't the root cause of your installation failure. The critical blocking issue is the "Maximum call stack size exceeded" error, so we'll prioritize fixing that first. If you run into GraphQL-related problems later, you can circle back to installing this peer dependency.
3. npm ERR! Maximum call stack size exceeded
This is the main issue stopping your installation, and it’s directly tied to your outdated Node.js and npm versions:
- Node.js v10.14.2 reached end-of-life (EOL) in April 2020 and is no longer supported by AWS Amplify CLI.
- npm 6.4.1 is also outdated and has known bugs that can trigger stack overflow errors during global package installs.
Fixes to resolve this:
Step 1: Clear npm's cache
Corrupted cache files can cause unexpected install issues. Run this command to wipe them:npm cache clean --forceStep 2: Upgrade npm to the latest compatible version for Node.js v10
Node.js v10 supports npm up to version 6.14.13. Upgrade with:npm install -g npm@6.14.13Step 3: Reinstall Amplify CLI with admin privileges
On Windows, global npm installs sometimes need elevated permissions. Right-click your terminal (Command Prompt/PowerShell) and select "Run as administrator", then execute:npm install -g @aws-amplify/cliIf the above fails: Upgrade Node.js to a supported LTS version
The most reliable long-term fix is moving to an active LTS Node.js release (like v16.x or v18.x). AWS Amplify CLI officially supports these newer versions, which will eliminate compatibility gaps and the stack overflow error entirely.
内容的提问来源于stack exchange,提问作者Pankaj

