Yarn: [0.17.0] Regression: Doesn't run `install` script

Created on 15 Nov 2016  ยท  10Comments  ยท  Source: yarnpkg/yarn

After upgrading to 0.17.0, I noticed install scripts are not running.

To test, run:

yarn add nodent-runtime
ls ./node_modules/nodent-runtime/dist

There should be an index.js built there, but there is not.

The package.json for that package:

  "scripts": {
    "test": "node tests",
    "install": "node build.js"
  },

This does not happen in 0.16.1.

Most helpful comment

After moving my ~/.npmrc in and out, I'm not able to reproduce this. Something pretty bizarre there, like a run of yarn without an .npmrc present reset something internal which fixed the bug.

If anyone else is experiencing this, working off https://github.com/STRML/yarn-install-lifecycle-bug might help you get to the bottom of it.

All 10 comments

I just tested this on latest master and it does generate a ./node_modules/nodent-runtime/dist/index.js file.

I tested this on 0.17.0 and the scripts run fine for me. What node version an OS are you on?

v6.7.0 on macOS Sierra for me.

OSX El Capitan, here's the output:

~/g/forks $ mkdir footest
~/g/forks $ cd footest
~/g/f/footest $ yarn add nodent-runtime
yarn add v0.17.2
info No lockfile found.
[1/4] ๐Ÿ”  Resolving packages...
[2/4] ๐Ÿšš  Fetching packages...
[3/4] ๐Ÿ”—  Linking dependencies...
[4/4] ๐Ÿ“ƒ  Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
โ””โ”€ [email protected]
โœจ  Done in 1.11s.
~/g/f/footest $ tree
.
โ”œโ”€โ”€ node_modules
โ”‚ย ย  โ””โ”€โ”€ nodent-runtime
โ”‚ย ย      โ”œโ”€โ”€ LICENSE
โ”‚ย ย      โ”œโ”€โ”€ build.js
โ”‚ย ย      โ”œโ”€โ”€ dist
โ”‚ย ย      โ”‚ย ย  โ””โ”€โ”€ README.md
โ”‚ย ย      โ”œโ”€โ”€ package.json
โ”‚ย ย      โ”œโ”€โ”€ runtime.js
โ”‚ย ย      โ”œโ”€โ”€ tests
โ”‚ย ย      โ”‚ย ย  โ””โ”€โ”€ index.js
โ”‚ย ย      โ”œโ”€โ”€ thenable.js
โ”‚ย ย      โ”œโ”€โ”€ thenableFactory.js
โ”‚ย ย      โ””โ”€โ”€ zousan.js
โ”œโ”€โ”€ package.json
โ””โ”€โ”€ yarn.lock

4 directories, 11 files
~/g/f/footest $ node --version
v6.9.1
~/g/f/footest $

macOS Sierra 10.12.1, node 6.9.1

Can't reproduce neither with current master (4ce67f3d5da3ba99c3e8718100883e9f145ce125) nor with 0.17.0.

@STRML or @kevinzwhuang can you provide a Dockerfile to reproduce?

Can't reproduce this on latest either

@STRML, can you clear caches?

Clearing caches doesn't help - but it appears my npmrc is the culprit.

Moving it out fixed the issue. What's perplexing is that when moving back in, the issue remained fixed.

The contents of my ~/.npmrc:

_auth=xxxx
init.author.name=My Name
[email protected]
init.author.url=http://strml.net/
always-auth=true
spin=false
loglevel=http
@private:registry=http://xx.xx.xx.xx:4873
//xx.xx.xx.xx:4873/:_password=xxxxxx
//xx.xx.xx.xx:4873/:username=myusername
//xx.xx.xx.xx:4873/:[email protected]
//registry.npmjs.org/:_password=xxxxxx
//registry.npmjs.org/:username=myusername
//registry.npmjs.org/:[email protected]
//xx.xx.xx.xx:4873/:always-auth=true
//registry.npmjs.org/:always-auth=true
registry=https://registry.npmjs.org/
[email protected]
progress=false

I'm working on a Dockerfile to see if I can reproduce it.

After moving my ~/.npmrc in and out, I'm not able to reproduce this. Something pretty bizarre there, like a run of yarn without an .npmrc present reset something internal which fixed the bug.

If anyone else is experiencing this, working off https://github.com/STRML/yarn-install-lifecycle-bug might help you get to the bottom of it.

I recommend closing this issue since the issue can't be reproduced. If someone can reproduce the issue, it can be re-opened.

@bestander This seems to have been fixed as of v0.17.4 - Also tested for the similar node-sass case in #1832: https://github.com/yarnpkg/yarn/issues/1832#issuecomment-261377646

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DannyBrown picture DannyBrown  ยท  89Comments

donovan-graham picture donovan-graham  ยท  115Comments

jiripospisil picture jiripospisil  ยท  128Comments

jmorrell picture jmorrell  ยท  93Comments

id77 picture id77  ยท  109Comments