安装Protractor-Cucumber相关依赖时遇domino版本匹配错误求助
Hey there, let's break down what's causing this issue and fix it step by step!
The Core Problem
Looking at your package.json, the root issue is a version mismatch in your Angular dependencies:
- All your main Angular packages (
@angular/animations,@angular/common, etc.) are on version6.0.0 - But
@angular/platform-serveris stuck on^2.0.1, which is way older and incompatible with Angular 6.
This outdated @angular/platform-server is forcing npm to look for domino@2.0.1—a version that's likely no longer available in the npm registry or conflicts with your project's newer dependencies.
Step-by-Step Solution
Fix the Angular Platform Server and Domino Versions
First, remove the mismatched packages:npm uninstall @angular/platform-server dominoThen install versions that match your Angular 6 setup:
npm install @angular/platform-server@6.0.0 domino@^2.1.4 --saveNote:
domino@2.1.4is the compatible version for Angular 6.x.Clean Up npm Cache
Clear any cached outdated dependency data to avoid conflicts:npm cache clean --forceReinstall All Dependencies Fresh
Delete your existingnode_modulesand lock file to start with a clean slate:# For macOS/Linux rm -rf node_modules package-lock.json # For Windows (Command Prompt) rmdir /s /q node_modules && del package-lock.jsonThen reinstall all dependencies:
npm installInstall Your Protractor-Cucumber Dependencies
Now try installing the original dependencies again—this should work without the domino error:npm install --save-dev protractor-cucumber-framework cucumber chai chai-as-promised @types/cucumber @types/chai @types/chai-as-promised
Why This Works
By aligning all your Angular package versions to 6.0.0, you eliminate the cross-version dependency conflict. The newer compatible domino version will be pulled in automatically, and npm won't try to fetch the unavailable 2.0.1 version anymore.
内容的提问来源于stack exchange,提问作者simond

