Commit f0419a7a by xzyfer

Fix npm rebuild

Running `npm rebuild node-sass` as we instruct people, has been
noop for a while. I'm not entirely sure what has changed.

Debugging as reveal that running `rebuild` now just triggers the
`install` and `postinstall` scripts. The `build` script is no
longer run. This suggests something has changed in newer versions
of npm.

Since the `--force` flag is required to rebuild the binary I've
update the `build` script to take into account if `--force` was
passed to npm.
parent c048687b
...@@ -25,7 +25,7 @@ function foundBinariesList() { ...@@ -25,7 +25,7 @@ function foundBinariesList() {
function missingBinaryFooter() { function missingBinaryFooter() {
return [ return [
'This usually happens because your environment has changed since running `npm install`.', 'This usually happens because your environment has changed since running `npm install`.',
'Run `npm rebuild node-sass` to build the binding for your current environment.', 'Run `npm rebuild node-sass --force` to build the binding for your current environment.',
].join('\n'); ].join('\n');
} }
......
...@@ -93,7 +93,8 @@ function build(options) { ...@@ -93,7 +93,8 @@ function build(options) {
function parseArgs(args) { function parseArgs(args) {
var options = { var options = {
arch: process.arch, arch: process.arch,
platform: process.platform platform: process.platform,
force: process.env.npm_config_force === 'true',
}; };
options.args = args.filter(function(arg) { options.args = args.filter(function(arg) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment