yarn icon indicating copy to clipboard operation
yarn copied to clipboard

Lack of globally installed node-gyp package causes yarn.lock file to not be created when yarn says it was

Open jharris4 opened this issue 7 years ago • 32 comments

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

Bug

What is the current behavior?

Adding an the uws package to a package.json dependencies section causes yarn to report that it created the lock file successfully, but the lock file does not exist.

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

Create an empty folder with the following package.json file:

{
  "name": "yarn-lock-bug",
  "version": "1.0.0",
  "description": "repro bug with yarn not creating lock file",
  "author": "jharris4",
  "license": "MIT",
  "dependencies": {
    "engine.io-parser": "~2.1.0"
  },
  "optionalDependencies": {
    "uws": "~0.14.4"
  }
}

Then run yarn install. It will report success Saved lockfile. but the yarn.lock file does not exist.

Removing the dependency and running the same steps (with rm -rf node_modules and rm yarn.lock first if necessary to start from a clean state) does not produce the bug:

{
  "name": "yarn-lock-bug",
  "version": "1.0.0",
  "description": "repro bug with yarn not creating lock file",
  "author": "jharris4",
  "license": "MIT",
  "dependencies": {
    "engine.io-parser": "~2.1.0"
  }
}

Note that running yarn install a second time does correctly create the lock file.

This bug might have something to do with the fact that the uws package uses an install script with node-gyp: https://github.com/uNetworking/bindings/blob/master/nodejs/dist/package.json

What is the expected behavior?

The yarn.lock file should always be created when the yarn cli reports that it was.

Please mention your node.js, yarn and operating system version. MacOS 10.12.5 Node 8.1.2 Yarn 0.24.6

jharris4 avatar Jun 26 '17 13:06 jharris4