克隆GitHub上的PartsUnlimited项目运行时npm install报错9009求助
Hey there, let's work through this exit code 9009 error you're hitting when trying to run npm install for the PartsUnlimited project. This error is almost always a Windows-specific issue that means your system can't locate the npm command. Here's how to resolve it step by step:
Check if Node.js (and npm) is installed
npm comes bundled with Node.js, so first confirm you have Node.js set up. Open Command Prompt or PowerShell and run these two commands:node -v npm -vIf both return version numbers, Node.js and npm are installed. If you get a "not recognized as an internal or external command" message, you'll need to install Node.js first.
Verify npm is in your system PATH
If Node.js is installed but you still see the error, the most likely culprit is that the npm executable path isn't added to your system's environment variables:- Find your Node.js installation directory (default paths are
C:\Program Files\nodejs\orC:\Program Files (x86)\nodejs\— this folder should containnpm.cmd). - Open System Environment Variables: Right-click "This PC" → Properties → Advanced System Settings → Environment Variables.
- Under "System Variables", locate the
Pathvariable, click "Edit", and check if the Node.js directory path is listed. If not, click "New" and add it. - Critical step: Restart your Command Prompt/PowerShell (or even your entire computer) to make sure the updated PATH takes effect.
- Find your Node.js installation directory (default paths are
Test the fix and re-run the install
After restarting your command line tool, runnpm -vagain. If it shows the version number, navigate back to your PartsUnlimited project directory (where thepackage.jsonfile lives) and re-run:npm install --loglevel=errorThis should now execute without the 9009 error.
Extra troubleshooting if issues persist
- Try clearing the npm cache with:
npm cache clean --force - Double-check you're running the command from the correct folder (the one containing
package.json— it's easy to accidentally be in a parent or subfolder instead).
- Try clearing the npm cache with:
内容的提问来源于stack exchange,提问作者IOSporgrammerIOS

