yarnpkg/yarn

Packages with build artifacts missing, but listed in .yarn-integrity, should be rebuilt.

Open

#3781 opened on Jun 30, 2017

View on GitHub
 (5 comments) (0 reactions) (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?

Packages are not rebuilt if all non-build artifacts already exist at the destination. This results in errors like:

module.js:327
    throw err;
    ^

Error: Cannot find module '../build/Release/hash'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/.../node_modules/xxhash/lib/xxhash.js:4:13)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)

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

$ yarn add xxhash
$ rm node_modules/xxhash/build/Release/hash.node
// Bring in an updated yarn.lock (i.e., via git)
$ yarn 
// xxhash does not get rebuilt

What is the expected behavior?

If a file contained in .yarn-integrity is missing (or maybe even the wrong size or mtime), the package should be rebuilt.

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

node@4.8.2 yarn@master:HEAD (69574f6a695a4184d349876ff196905e7fb992be) Docker ubuntu12.04

Related: https://github.com/yarnpkg/yarn/issues/231 https://github.com/yarnpkg/yarn/issues/1955#issuecomment-293728671 https://github.com/yarnpkg/yarn/issues/1955#issuecomment-296745770

Contributor guide