Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: postinstall/install script not being run on dependencies #1872

Closed
kevinzwhuang opened this issue Nov 15, 2016 · 5 comments
Closed

Bug: postinstall/install script not being run on dependencies #1872

kevinzwhuang opened this issue Nov 15, 2016 · 5 comments

Comments

@kevinzwhuang
Copy link
Contributor

kevinzwhuang commented Nov 15, 2016

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

This is a bug/regression - has been present since 0.17.0.

What is the current behavior?

Postinstall/Install scripts for dependencies are not being run. As a result, libraries that depend on an extra post install step will fail.

For example, I installed node-sass on my project with yarn. Trying to use node-sass will result in this stack trace:

15:11:14 assets.1 | ERROR in ENOENT: no such file or directory, scandir '/home/kevin/signal/node_modules/node-sass/vendor'
15:11:14 assets.1 |  @ ./~/react-select/scss/default.scss 4:14-98
15:11:14 assets.1 |
15:11:14 assets.1 | ERROR in ENOENT: no such file or directory, scandir '/home/kevin/signal/node_modules/node-sass/vendor'
15:11:14 assets.1 |  @ ./~/style-loader!./~/css-loader!./~/resolve-url-loader!./~/sass-loader?sourceMap!./~/bootstrap-loader/lib/bootstrap.styles.loader.js!./~/bootstrap-loader/no-op.js 4:14-164
15:11:14 assets.1 |
15:11:14 assets.1 | ERROR in ./~/react-select/scss/default.scss
15:11:14 assets.1 | Module build failed: Error: ENOENT: no such file or directory, scandir '/home/kevin/signal/node_modules/node-sass/vendor'
15:11:14 assets.1 |     at Error (native)
15:11:14 assets.1 |     at Object.fs.readdirSync (fs.js:951:18)
15:11:14 assets.1 |     at Object.getInstalledBinaries (/home/kevin/signal/node_modules/node-sass/lib/extensions.js:119:13)
15:11:14 assets.1 |     at foundBinariesList (/home/kevin/signal/node_modules/node-sass/lib/errors.js:20:15)
15:11:14 assets.1 |     at foundBinaries (/home/kevin/signal/node_modules/node-sass/lib/errors.js:15:5)
15:11:14 assets.1 |     at Object.module.exports.missingBinary (/home/kevin/signal/node_modules/node-sass/lib/errors.js:45:5)
15:11:14 assets.1 |     at Object.<anonymous> (/home/kevin/signal/node_modules/node-sass/lib/index.js:15:28)
15:11:14 assets.1 |     at Module._compile (module.js:570:32)
15:11:14 assets.1 |     at Object.Module._extensions..js (module.js:579:10)
15:11:14 assets.1 |     at Module.load (module.js:487:32)
15:11:14 assets.1 | Child extract-text-webpack-plugin:
15:11:14 assets.1 |
15:11:14 assets.1 |     ERROR in ENOENT: no such file or directory, scandir '/home/kevin/signal/node_modules/node-sass/vendor'
15:11:14 assets.1 | webpack: bundle is now VALID.

This can be cleared by going to my node_modules folder and running the install script manually with:
node node_modules/node_sass/scripts/install.js
From : https://github.com/sass/node-sass/blob/master/package.json#L31

There's been a similar issue reported at node-sass: sass/node-sass#1804

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

What is the expected behavior?

The install script should be run automatically for dependencies once installed by yarn.

Yarn nightly - v0.18.0-20161115.2218
OS: Ubuntu 16.04.1 LTS + 4.8.7-040807-generic Linux Kernel
Also reproduced on OS X El Capitan
Node: v6.9.1

@kevinzwhuang kevinzwhuang changed the title custom install script not being run on dependencies Bug: custom install script not being run on dependencies Nov 15, 2016
@kevinzwhuang kevinzwhuang reopened this Nov 15, 2016
@kevinzwhuang kevinzwhuang changed the title Bug: custom install script not being run on dependencies Bug: postinstall/install script not being run on dependencies Nov 15, 2016
@kevinzwhuang
Copy link
Contributor Author

This might be a dupe of #1852

@wyze
Copy link
Member

wyze commented Nov 16, 2016

Yes, duplicate of #1852.

@wyze wyze closed this as completed Nov 16, 2016
@wyze wyze added the duplicate label Nov 16, 2016
@bestander
Copy link
Member

Looks like #1852 is different

@bestander bestander reopened this Nov 17, 2016
@wyze wyze removed the duplicate label Nov 17, 2016
@bestander
Copy link
Member

bestander commented Nov 17, 2016

So I am trying to repro on master branch:

$ yarn add node-sass
yarn add v0.18.0-0
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 180 new dependencies.
├─ abbrev@1.0.9
...
✨  Done in 8.94s.
$ ls -al node_modules/node-sass/vendor/darwin-x64-48/
total 5088
drwxr-xr-x  3 bestander Domain Users      102 Nov 17 16:02 .
drwxr-xr-x  3 bestander  Domain Users      102 Nov 17 16:01 ..
-rw-r--r--  1 bestander  Domain Users  2602136 Nov 17 16:02 binding.node

Everything seems in place.
Can anyone give me a 100% list of commands to reproduce this?
Is it linux/windows only?

I think binding.node is downloaded instead of being rebuilt.
Could that be a reason?

@bestander
Copy link
Member

This is a duplicate of #1832, let's continue discussion there please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants