codeclimate / javascript-test-reporter

DEPRECATED Code Climate test reporter client for JavaScript projects

Home Page:https://codeclimate.com

Repository from Github https://github.comcodeclimate/javascript-test-reporterRepository from Github https://github.comcodeclimate/javascript-test-reporter

Shrinkwrap broken when using 0.3.2 as a devDependencies

johanneswuerbach opened this issue · comments

Looks like shrink-wrapping using npm 2 is broken since #39 has been merged.

Problems were encountered
Please correct and try again.
extraneous: abbrev@1.0.7 app/node_modules/codeclimate-test-reporter/node_modules/abbrev
extraneous: align-text@0.1.4 app/node_modules/codeclimate-test-reporter/node_modules/align-text
extraneous: amdefine@1.0.0 app/node_modules/codeclimate-test-reporter/node_modules/amdefine
extraneous: argparse@1.0.7 app/node_modules/codeclimate-test-reporter/node_modules/argparse
extraneous: balanced-match@0.4.1 app/node_modules/codeclimate-test-reporter/node_modules/balanced-match

Pinning codeclimate-test-reporter to 0.3.1 solved the issue.

May I ask why you include a shrinkwrap file in this module itself?

Hey @johanneswuerbach,

I'm having some trouble reproducing the error you're encountering. The following works for me on a clean project.

$ npm install --save-dev codeclimate-test-reporter && npm shrinkwrap

Have you tried a fresh npm install or running npm prune first?

May I ask why you include a shrinkwrap file in this module itself?

I may be mistaken but I don't think this project's shrinkwrap file should affect your npm install/shrinkwrap process. We've included the file to lock down dependencies during development.

Did you move the codeclimate-test-reporter from dependencies to devDependencies within your project recently? If you need to include devDependencies, you'll have to pass an additional flag to npm shrinkwrap. They are not included by default.

$ npm shrinkwrap --dev

Which npm version are you using? npm install --save-dev codeclimate-test-reporter && npm shrinkwrap breaks for me using 2.15.1 (the latest bundled version with node 4 lts).

I may be mistaken but I don't think this project's shrinkwrap file should affect your npm install/shrinkwrap process

When I'm not mistaken, when npm finds a npm-shrinkwrap.json inside a module it will exactly install this subtree for the module instead of doing its usual de-dupe and module resolving.

Yep, looks like that's the current behavior in node 4.4.5 running npm 2.15.5 or 3.9.5. I was able to reproduce the same error in a docker container:

root@44b170200e58:/tmp/test# npm shrinkwrap
npm info it worked if it ends with ok
npm info using npm@2.15.5
npm info using node@v4.4.5
npm ERR! Linux 4.4.8-boot2docker
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "shrinkwrap"
npm ERR! node v4.4.5
npm ERR! npm  v2.15.5

npm ERR! Problems were encountered
npm ERR! Please correct and try again.
npm ERR! extraneous: abbrev@1.0.7 /tmp/test/node_modules/codeclimate-test-reporter/node_modules/abbrev
npm ERR! extraneous: align-text@0.1.4 /tmp/test/node_modules/codeclimate-test-reporter/node_modules/align-text
npm ERR! extraneous: amdefine@1.0.0 /tmp/test/node_modules/codeclimate-test-reporter/node_modules/amdefine
npm ERR! extraneous: argparse@1.0.7 /tmp/test/node_modules/codeclimate-test-reporter/node_modules/argparse

Interesting that the same process does not error in node 5:

root@ed2d5a4bc940:/tmp/test# npm shrinkwrap
npm info it worked if it ends with ok
npm info using npm@3.8.6
npm info using node@v5.11.1
npm WARN shrinkwrap Excluding devDependency: codeclimate-test-reporter@0.3.2 {}
wrote npm-shrinkwrap.json
npm info ok
root@ed2d5a4bc940:/tmp/test# npm shrinkwrap --dev
npm info it worked if it ends with ok
npm info using npm@3.8.6
npm info using node@v5.11.1
wrote npm-shrinkwrap.json
npm info ok

The value of a shrinkwrap file is certainly not worth breaking install processes so I'll open up a PR to remove it. Thanks for the report!

Hey @johanneswuerbach,

I just released v0.3.3 of the test reporter which should fix this issue. Thanks again for the report 👍

Going to go ahead and close this issue.

Thanks, v0.3.3 solved it for me. 🙇