Nubescope / sinon-mongoose

Extend Sinon stubs for Mongoose methods to test chained methods easily
MIT License
87 stars 29 forks source link

Install failing with unmet sinon peer dependency #12

Closed felipecao closed 7 years ago

felipecao commented 7 years ago

I'm trying to setup sinon-mongoose in my project, but npm install -D sinon-mongoose fails with UNMET PEER DEPENDENCY sinon@2.1.0.

I'm a complete newbie at unit testing with JS, so I might as well be doing something wrong. Here's my current package.json:

{
  "name": "slack-lunch",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
    "dev": "nodemon server.js",
    "test": "./node_modules/.bin/mocha --recursive --compilers js:babel-core/register",
    "tdd": "./node_modules/.bin/mocha --recursive --compilers js:babel-core/register -w"
  },
  "keywords": [
    "slack",
    "lunch",
    "express",
    "node"
  ],
  "author": "felipecao",
  "license": "ISC",
  "dependencies": {
    "body-parser": "^1.17.1",
    "ejs": "^2.5.6",
    "express": "^4.15.2",
    "mongodb": "^2.2.25",
    "mongoose": "^4.9.2",
    "mongoose-random": "^0.1.1"
  },
  "devDependencies": {
    "babel-core": "^6.24.0",
    "babel-loader": "^6.4.1",
    "babel-preset-es2015": "^6.24.0",
    "chai": "^3.5.0",
    "mocha": "^3.2.0",
    "nodemon": "^1.11.0",
    "proxyquire": "^1.7.11",
    "sinon": "^2.1.0",
    "sinon-mongoose": "^1.3.0"
  }
}

And this is the console output of npm install -D sinon-mongoose --verbose:

npm info it worked if it ends with ok
npm verb cli [ '/Users/felipe/.nvm/versions/node/v5.1.0/bin/node',
npm verb cli   '/Users/felipe/.nvm/versions/node/v5.1.0/bin/npm',
npm verb cli   'install',
npm verb cli   '-D',
npm verb cli   'sinon-mongoose',
npm verb cli   '--verbose' ]
npm info using npm@3.3.12
npm info using node@v5.1.0
npm verb get https://registry.npmjs.org/sinon-mongoose not expired, no request
npm verb cache add spec sinon-mongoose@^1.3.0
npm verb addNamed ">=1.3.0 <2.0.0" is a valid semver range for sinon-mongoose
npm verb addNameRange registry:https://registry.npmjs.org/sinon-mongoose not in flight; fetching
npm verb get https://registry.npmjs.org/sinon-mongoose not expired, no request
npm verb addNamed "1.3.0" is a plain semver version for sinon-mongoose
npm verb afterAdd /Users/felipe/.npm/sinon-mongoose/1.3.0/package/package.json not in flight; writing
npm verb afterAdd /Users/felipe/.npm/sinon-mongoose/1.3.0/package/package.json written
npm verb lock using /Users/felipe/.npm/_locks/staging-113bc65bdcf82ac5.lock for /Users/felipe/workspace/github/slack-lunch/node_modules/.staging
npm verb unbuild node_modules/.staging/sinon-mongoose-1eb3c89e3c82681aae026f0e5665eab6
npm verb gentlyRm don't care about contents; nuking /Users/felipe/workspace/github/slack-lunch/node_modules/.staging/sinon-mongoose-1eb3c89e3c82681aae026f0e5665eab6
npm verb tar unpack /Users/felipe/.npm/sinon-mongoose/1.3.0/package.tgz
npm verb tar unpacking to /Users/felipe/workspace/github/slack-lunch/node_modules/.staging/sinon-mongoose-1eb3c89e3c82681aae026f0e5665eab6
npm verb gentlyRm don't care about contents; nuking /Users/felipe/workspace/github/slack-lunch/node_modules/.staging/sinon-mongoose-1eb3c89e3c82681aae026f0e5665eab6
npm info lifecycle sinon-mongoose@1.3.0~preinstall: sinon-mongoose@1.3.0
npm info linkStuff sinon-mongoose@1.3.0
npm verb linkBins sinon-mongoose@1.3.0
npm verb linkMans sinon-mongoose@1.3.0
npm info lifecycle sinon-mongoose@1.3.0~install: sinon-mongoose@1.3.0
npm info lifecycle sinon-mongoose@1.3.0~postinstall: sinon-mongoose@1.3.0
npm verb unlock done using /Users/felipe/.npm/_locks/staging-113bc65bdcf82ac5.lock for /Users/felipe/workspace/github/slack-lunch/node_modules/.staging
npm verb saving [ { name: 'sinon-mongoose',
npm verb saving     spec: '^1.3.0',
npm verb saving     save: 'devDependencies' } ]
slack-lunch@1.0.0 /Users/felipe/workspace/github/slack-lunch
├── UNMET PEER DEPENDENCY sinon@2.1.0
└── sinon-mongoose@1.3.0

npm WARN EPEERINVALID sinon-mongoose@1.3.0 requires a peer of sinon@1 but none was installed.
npm WARN EPACKAGEJSON slack-lunch@1.0.0 No repository field.
npm verb exit [ 0, true ]
npm info ok

Am I doing anything wrong in my setup? Help is highly appreciated! :)

gaguirre commented 7 years ago

Are you sure is nothing else that a WARN? See if the package was installed (i.e. check if node_modules/sinon-mongoose exists)

felipecao commented 7 years ago

The package is there, my bad (damn newbies! :) ). Sorry about that, and thanks a lot for the great work in sinon-mongoose!

gaguirre commented 7 years ago

@felipecao glad to know it's working and thank you!