I tried to install sinon
via npm: npm install sinon --save-dev
But I got a unmet peer dependency error:
├── UNMET PEER DEPENDENCY sinon@2.3.8
└── sinon-chai@2.8.0 extraneous
npm ERR! peer dep missing: sinon@>=1.4.0 <2, required by sinon-chai@2.8.0
I do not understand why sinon should be <2 as I installed the current version, which is 2.3.8
You have only misunderstood the error message. It's telling you that sinon-chai
requires sinon
in the range >=1.4.0 <2
. Installing version 2.3.8
does not provide a compatible version to sinon-chai
.
You have two choices: either specifically install a version of sinon
in the given range; or update sinon-chai
to version 2.12.0
, which supports a more recent version range:
"dependencies": {
"sinon-chai": "^2.12.0",
"sinon": "^2.3.8",
...
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.