Closed chriswatrous closed 6 years ago
I also tried with node v6.13.1 and it gave me a 493 line stack trace.
Well this is wierd. If I delete node_modules
but leave package-lock.json
and reinstall, it works fine, and I get a very different output from npm list
.
bash> npm list
/Users/chris/projects/rmc/test
└─┬ mock-couch@0.1.10
├── color-convert@1.0.0 extraneous
├── couch-viewkey-compare@1.0.1
├── grunt@0.4.5 extraneous
├── grunt-jasmine-nodejs@1.5.2 extraneous
├── grunt-jslint@1.1.14 extraneous
├── ramda@0.8.0
├─┬ restify@6.4.0
│ ├── assert-plus@1.0.0
│ ├─┬ bunyan@1.8.12
│ │ ├── dtrace-provider@0.8.7 deduped
│ │ ├── moment@2.22.2
│ │ ├─┬ mv@2.1.1
│ │ │ ├─┬ mkdirp@0.5.1
│ │ │ │ └── minimist@0.0.8
│ │ │ ├── ncp@2.0.0
│ │ │ └─┬ rimraf@2.4.5
│ │ │ └─┬ glob@6.0.4
│ │ │ ├─┬ inflight@1.0.6
│ │ │ │ ├── once@1.4.0 deduped
│ │ │ │ └── wrappy@1.0.2 deduped
│ │ │ ├── inherits@2.0.3 deduped
│ │ │ ├─┬ minimatch@3.0.4
│ │ │ │ └─┬ brace-expansion@1.1.11
│ │ │ │ ├── balanced-match@1.0.0
│ │ │ │ └── concat-map@0.0.1
│ │ │ ├── once@1.4.0 deduped
│ │ │ └── path-is-absolute@1.0.1
│ │ └── safe-json-stringify@1.2.0
│ ├─┬ clone-regexp@1.0.1
│ │ ├── is-regexp@1.0.0
│ │ └── is-supported-regexp-flag@1.0.1
│ ├─┬ csv@1.2.1
│ │ ├── csv-generate@1.1.2
│ │ ├── csv-parse@1.3.3
│ │ ├─┬ csv-stringify@1.1.2
│ │ │ └── lodash.get@4.4.2
│ │ └── stream-transform@0.2.2
│ ├─┬ dtrace-provider@0.8.7
│ │ └── nan@2.10.0
│ ├── escape-regexp-component@1.0.2
│ ├─┬ ewma@2.0.1
│ │ └── assert-plus@1.0.0 deduped
│ ├── formidable@1.2.1
│ ├─┬ http-signature@1.2.0
│ │ ├── assert-plus@1.0.0 deduped
│ │ ├─┬ jsprim@1.4.1
│ │ │ ├── assert-plus@1.0.0 deduped
│ │ │ ├── extsprintf@1.3.0 deduped
│ │ │ ├── json-schema@0.2.3
│ │ │ └── verror@1.10.0 deduped
│ │ └─┬ sshpk@1.14.2
│ │ ├── asn1@0.2.3
│ │ ├── assert-plus@1.0.0 deduped
│ │ ├─┬ bcrypt-pbkdf@1.0.1
│ │ │ └── tweetnacl@0.14.5 deduped
│ │ ├─┬ dashdash@1.14.1
│ │ │ └── assert-plus@1.0.0 deduped
│ │ ├─┬ ecc-jsbn@0.1.1
│ │ │ └── jsbn@0.1.1 deduped
│ │ ├─┬ getpass@0.1.7
│ │ │ └── assert-plus@1.0.0 deduped
│ │ ├── jsbn@0.1.1
│ │ ├── safer-buffer@2.1.2
│ │ └── tweetnacl@0.14.5
│ ├── lodash@4.17.10
│ ├─┬ lru-cache@4.1.3
│ │ ├── pseudomap@1.0.2
│ │ └── yallist@2.1.2
│ ├── mime@1.6.0
│ ├── negotiator@0.6.1
│ ├─┬ once@1.4.0
│ │ └── wrappy@1.0.2
│ ├── pidusage@1.2.0
│ ├── qs@6.5.2
│ ├─┬ restify-errors@5.0.0
│ │ ├── assert-plus@1.0.0 deduped
│ │ ├── lodash@4.17.10 deduped
│ │ ├── safe-json-stringify@1.2.0 deduped
│ │ └── verror@1.10.0 deduped
│ ├── semver@5.5.0
│ ├─┬ spdy@3.4.7
│ │ ├─┬ debug@2.6.9
│ │ │ └── ms@2.0.0
│ │ ├── handle-thing@1.2.5
│ │ ├── http-deceiver@1.2.7
│ │ ├── safe-buffer@5.1.2
│ │ ├── select-hose@2.0.0
│ │ └─┬ spdy-transport@2.1.0
│ │ ├── debug@2.6.9 deduped
│ │ ├── detect-node@2.0.3
│ │ ├─┬ hpack.js@2.1.6
│ │ │ ├── inherits@2.0.3
│ │ │ ├── obuf@1.1.2 deduped
│ │ │ ├── readable-stream@2.3.6 deduped
│ │ │ └── wbuf@1.7.3 deduped
│ │ ├── obuf@1.1.2
│ │ ├─┬ readable-stream@2.3.6
│ │ │ ├── core-util-is@1.0.2 deduped
│ │ │ ├── inherits@2.0.3 deduped
│ │ │ ├── isarray@1.0.0
│ │ │ ├── process-nextick-args@2.0.0
│ │ │ ├── safe-buffer@5.1.2 deduped
│ │ │ ├─┬ string_decoder@1.1.1
│ │ │ │ └── safe-buffer@5.1.2 deduped
│ │ │ └── util-deprecate@1.0.2
│ │ ├── safe-buffer@5.1.2 deduped
│ │ └─┬ wbuf@1.7.3
│ │ └── minimalistic-assert@1.0.1
│ ├── uuid@3.2.1
│ ├─┬ vasync@1.6.4
│ │ └─┬ verror@1.6.0
│ │ └── extsprintf@1.2.0
│ └─┬ verror@1.10.0
│ ├── assert-plus@1.0.0 deduped
│ ├── core-util-is@1.0.2
│ └── extsprintf@1.3.0
└── underscore@1.8.3
npm ERR! extraneous: color-convert@1.0.0 /Users/chris/projects/rmc/test/node_modules/mock-couch/node_modules/color-convert
npm ERR! extraneous: grunt@0.4.5 /Users/chris/projects/rmc/test/node_modules/mock-couch/node_modules/grunt
npm ERR! extraneous: grunt-jasmine-nodejs@1.5.2 /Users/chris/projects/rmc/test/node_modules/mock-couch/node_modules/grunt-jasmine-nodejs
npm ERR! extraneous: grunt-jslint@1.1.14 /Users/chris/projects/rmc/test/node_modules/mock-couch/node_modules/grunt-jslint
If I delete node_modules
and package-lock.json
and reinstall, it fails again. Then if I just run npm install
again it works.
The purpose of package-lock.json is to specify exactly which version of each dependency it should install. If you delete node_modules but leave package-lock.json, it will reinstall each dependency, and it will make sure to install only the version that is specified there, which should guarantee that it will work.
If you delete package-lock.json (and you shouldn't do that) and then reinstall the dependencies, it will no longer check the version of each dependency, which could cause it to install broken dependencies.
According to your last comment, for some reason, if you delete both, reinstall, and then again execute npm install
, it will install valid dependencies.
But as long reinstalling the dependencies with package-lock.json present works correctly, then it cannot be considered a problem of mock-couch.
I cannot replicate your problem; using the same node and npm versions as you (node v8.9.1 and npm v6.1.0), I executed the following commands:
mkdir test-mock
cd test-mock
npm init -y
npm install --save mock-couch
echo "require('mock-couch');">test.js
node test.js
# last command produces no output and returns without problems
Try to do that. If that works, then mock-couch is working correctly and for some reason you had broken dependencies installed on your project.
I must mention I did my tests using linux and not macos. Then again, I don't think that is related.
I'm having a problem with node crashing when I require mock-couch.
package.json
test.js
I wonder if the problem is related to
restify@2.8.5 invalid
? I'm not sure what that means.