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

Rebuild node-sass after yarn install #1946

Merged
merged 1 commit into from Jun 8, 2017
Merged

Conversation

tnation14
Copy link
Contributor

@tnation14 tnation14 commented Jun 7, 2017

Overview

Occasionally, CI builds will fail becausenode-sass is missing the linux binding in the vendor directory:

ModuleBuildError: Module build failed: Error: ENOENT: no such file or directory, scandir '/opt/raster-foundry/app-frontend/node_modules/node-sass/vendor'
    at Error (native)
    at Object.fs.readdirSync (fs.js:951:18)
    at Object.getInstalledBinaries (/opt/raster-foundry/app-frontend/node_modules/node-sass/lib/extensions.js:121:13)
    at foundBinariesList (/opt/raster-foundry/app-frontend/node_modules/node-sass/lib/errors.js:20:15)
    at foundBinaries (/opt/raster-foundry/app-frontend/node_modules/node-sass/lib/errors.js:15:5)
    at Object.module.exports.missingBinary (/opt/raster-foundry/app-frontend/node_modules/node-sass/lib/errors.js:45:5)
    at module.exports (/opt/raster-foundry/app-frontend/node_modules/node-sass/lib/binding.js:15:30)
    at Object.<anonymous> (/opt/raster-foundry/app-frontend/node_modules/node-sass/lib/index.js:14:35)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)

The official solution for this issue is to run npm rebuild node-sass, as documented in sass/node-sass#1579. This comment suggests a yarn postinstall step to rebuild node-sass, which is the approach I took in this PR.

Checklist

- [ ] Styleguide updated, if necessary
- [ ] Swagger specification updated, if necessary
- [ ] Symlinks from new migrations present or corrected for any new migrations

Demo

N/A

Notes

Another potential option was to install the missing binary directly, as explained here. I felt that this was too hacky, and didn't fit as cleanly into the cibuild process.

Testing Instructions

Closes #1385

@azavea-bot
Copy link

@tnation14, thanks for your PR! By analyzing the history of the files in this pull request, we identified @notthatbreezy, @Lknechtli, @alkamin, @ddohler and @hectcastro to be potential reviewers.

@hectcastro hectcastro removed the request for review from notthatbreezy June 8, 2017 12:52
@tnation14 tnation14 merged commit 0d074d0 into develop Jun 8, 2017
@tnation14 tnation14 deleted the feature/tnation/node-sass branch August 8, 2017 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants