Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
Enable install for node-chakracore
Browse files Browse the repository at this point in the history
Today, `npm install` downloads the pre-built `binding.node` binary from [node-sass repo](https://github.com/sass/node-sass/releases).
However these binaries are compiled using `nodev8` and an attempt to use it with [node-chakracore](https://github.com/nodejs/node-chakracore) would fail.
One option is to have `node-sass` host binaries pre-built using node-chakracore and during installation have a way to detect the engine (using `process.jsEngine')
and download the appropriate engine compliant binary. I have opened #1776 to start the discussion for this.

For now, as an interim solution, I have disabled downloading the pre-built binary if running with node-chakracore. In `postinstall` stage, it would see that the binary
is not present and then would build the binary (only one-time) with node-chakracore.
  • Loading branch information
kunalspathak authored and xzyfer committed Nov 3, 2016
1 parent 36856f4 commit 3ad08e7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ function checkAndDownloadBinary() {
if (sass.hasBinary(sass.getBinaryPath())) {
return;
}

if (process.jsEngine && process.jsEngine === 'chakracore') {
console.log('Installing using node-chakracore. Need rebuild of binary.');
return;
}

mkdir(path.dirname(sass.getBinaryPath()), function(err) {
if (err) {
Expand Down

0 comments on commit 3ad08e7

Please sign in to comment.