Skip to content

yarn run with bin in local node_modules #733

@billxinli

Description

@billxinli

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

What is the current behavior?
From npm with respect to npm run: In addition to the shell's pre-existing PATH, npm run adds node_modules/.bin to the PATH provided to scripts. Any binaries provided by locally-installed dependencies can be used without the node_modules/.bin prefix.

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

Add additional entry to the scripts section of the package.json without installing the dependency globally (in this case mocha).

  "scripts": {
    "test-api": "mocha test/api"
  },

What is the expected behavior?

If I run npm run test-api it will resolve mocha to the local copy. However yarn run test-api will produce:

$ "mocha test/api" 
sh: 1: mocha test/api: not found

Please mention your node.js, yarn and operating system version.
node: 6.7.0
yarn: 0.15
os: Ubuntu 16.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions