Skip to content

Optional dependency with a native module is not installed #670

@nebrius

Description

@nebrius

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

bug

What is the current behavior?

When I install johnny-five, it's optional dependency serialport with a native module (using node-pre-gyp) is missing from node_modules, but installing serialport directly works fine.

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

Using this package.json file:

{
  "name": "yarntest",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "dependencies": {
    "johnny-five": "^0.10.0"
  },
  "author": "",
  "license": "ISC"
}
  1. yarn cache clean
  2. rm yarn.lock
  3. yarn install
  4. cd node_modules
  5. find . -name serialport returns nothing

But, using this package.json file:

{
  "name": "yarntest",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "dependencies": {
    "serialport": "^4.0.0"
  },
  "author": "",
  "license": "ISC"
}
  1. yarn cache clean
  2. rm yarn.lock
  3. yarn install
  4. cd node_modules
  5. find . -name serialport shows it has been installed

What is the expected behavior?

Serialport should be installed as a dependency (the npm client works this way).

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

Node: 6.7.0
Yarn: 0.15.1
OS: Ubuntu 14.04 x64

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