yarnpkg/yarn

yarn 1.0.1 is generating extraneous dependencies

Open

#4417 opened on Sep 12, 2017

View on GitHub
 (9 comments) (1 reaction) (0 assignees)JavaScript (41,514 stars) (2,731 forks)batch import
cat-buggood first issuehelp wantedtriaged

Description

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

Running yarn introduces an extraneous dependency. This causes npm ls to subsequently return non-zero exit code which is breaking our CI system.

If the current behavior is a bug, please provide the steps to reproduce.

package.json

{
  "name": "foo",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "dependencies": {
    "nyc": "^11.2.1"
  }
}
  1. Run yarn
  2. Run npm ls
  3. Run echo $?

It outputs 1 because of extraneous dependencies:

npm ERR! extraneous: archy@1.0.0 /Users/camwest/Desktop/foo/node_modules/archy
npm ERR! extraneous: caching-transform@1.0.1 /Users/camwest/Desktop/foo/node_modules/caching-transform
npm ERR! extraneous: convert-source-map@1.5.0 /Users/camwest/Desktop/foo/node_modules/convert-source-map
npm ERR! extraneous: debug-log@1.0.1 /Users/camwest/Desktop/foo/node_modules/debug-log
npm ERR! extraneous: find-cache-dir@0.1.1 /Users/camwest/Desktop/foo/node_modules/find-cache-dir
npm ERR! extraneous: istanbul-lib-hook@1.0.7 /Users/camwest/Desktop/foo/node_modules/istanbul-lib-hook
npm ERR! extraneous: istanbul-lib-instrument@1.8.0 /Users/camwest/Desktop/foo/node_modules/istanbul-lib-instrument
npm ERR! extraneous: istanbul-lib-report@1.1.1 /Users/camwest/Desktop/foo/node_modules/istanbul-lib-report
npm ERR! extraneous: istanbul-lib-source-maps@1.2.1 /Users/camwest/Desktop/foo/node_modules/istanbul-lib-source-maps
npm ERR! extraneous: istanbul-reports@1.1.2 /Users/camwest/Desktop/foo/node_modules/istanbul-reports
npm ERR! extraneous: merge-source-map@1.0.4 /Users/camwest/Desktop/foo/node_modules/merge-source-map
npm ERR! extraneous: resolve-from@2.0.0 /Users/camwest/Desktop/foo/node_modules/resolve-from
npm ERR! extraneous: spawn-wrap@1.3.8 /Users/camwest/Desktop/foo/node_modules/spawn-wrap
npm ERR! extraneous: test-exclude@4.1.1 /Users/camwest/Desktop/foo/node_modules/test-exclude
npm ERR! extraneous: yargs@8.0.2 /Users/camwest/Desktop/foo/node_modules/yargs
npm ERR! extraneous: yargs-parser@5.0.0 /Users/camwest/Desktop/foo/node_modules/yargs-parser

What is the expected behavior?

Expected no extraneous dependencies or npm ls to return with a 0 exit code.

Please mention your node.js, yarn and operating system version.

node v6.11.1 yarn v1.0.1 macOS Sierra 10.12.6

Contributor guide