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

Commit

Permalink
Fix npm rebuild
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
xzyfer committed Feb 6, 2017
1 parent c048687 commit f0419a7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function foundBinariesList() {
function missingBinaryFooter() {
return [
'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');
}

Expand Down
3 changes: 2 additions & 1 deletion scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ function build(options) {
function parseArgs(args) {
var options = {
arch: process.arch,
platform: process.platform
platform: process.platform,
force: process.env.npm_config_force === 'true',
};

options.args = args.filter(function(arg) {
Expand Down

0 comments on commit f0419a7

Please # to comment.