2

I start with ionic. Many people faced the same mistakes but i tried all answers I found, I didn't get a result.

When I ran : ionic setup sass, i got this error at the end

Successful npm install

Updated F:\Documents\SED\Appli\Demo\www\index.html <link href> references to sass compiled css

Ionic project ready to use Sass!
 * Customize the app using scss/ionic.app.scss
 * Run ionic serve to start a local dev server and watch/compile Sass to CSS

F:\Documents\SED\Appli\Demo\node_modules\gulp-sass\node_modules\node-sass\lib\index.js:22
    throw new Error('`libsass` bindings not found. Try reinstalling `node-sass`?');
    ^

Error: `libsass` bindings not found. Try reinstalling `node-sass`?
    at getBinding (F:\Documents\SED\Appli\Demo\node_modules\gulp-sass\node_modules\node-sass\lib\index.js:22:11)
    at Object.<anonymous> (F:\Documents\SED\Appli\Demo\node_modules\gulp-sass\node_modules\node-sass\lib\index.js:188:23)



at Module._compile (module.js:434:26)
at Object.Module._extensions..js (module.js:452:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (F:\Documents\SED\Appli\Demo\node_modules\gulp-sass\index.js:3:17)
at Module._compile (module.js:434:26)

Exception with  (CLI v1.6.4)

Your system information:

Cordova CLI: 5.3.1
Gulp version:  CLI version 3.9.0
Gulp local:   Local version 3.9.0
Ionic Version: 1.1.0
Ionic CLI Version: 1.6.4
Ionic App Lib Version: 0.3.8
OS: null
Node Version: v4.0.0

I tried to re-install gulp and I got this error :

$ npm install gulp-sass
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data
npm WARN package.json [email protected] No license field.
npm WARN deprecated [email protected]: use node-gyp@3+, it does all the things





> [email protected] install F:\Documents\SED\Appli\Demo\node_modules\gulp-sass\node_modules\node-sass
> node scripts/install.js

Can not download file from https://raw.githubusercontent.com/sass/node-sass-binaries/v2.1.1/win32-x64-node-4.0/binding.node

> [email protected] postinstall F:\Documents\SED\Appli\Demo\node_modules\gulp-sass\node_modules\node-sass
> node scripts/build.js

gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: 404 status code downloading 64-bit node.lib
gyp ERR! stack     at Request.<anonymous> (F:\Documents\SED\Appli\Demo\node_modules\gulp-sass\node_modules\node-sass\node_modules\pangyp\lib\install.js:403:20)
gyp ERR! stack     at emitOne (events.js:82:20)
gyp ERR! stack     at Request.emit (events.js:169:7)
gyp ERR! stack     at Request.onRequestResponse (F:\Documents\SED\Appli\Demo\node_modules\gulp-sass\node_modules\node-sass\node_modules\pangyp\node_modules\request\request.js:1255:10)
gyp ERR! stack     at emitOne (events.js:77:13)
gyp ERR! stack     at ClientRequest.emit (events.js:169:7)
gyp ERR! stack     at HTTPParser.parserOnIncomingClient (_http_client.js:415:21)
gyp ERR! stack     at HTTPParser.parserOnHeadersComplete (_http_common.js:88:23)
gyp ERR! stack     at Socket.socketOnData (_http_client.js:305:20)
gyp ERR! stack     at emitOne (events.js:77:13)
gyp ERR! System Windows_NT 10.0.10240
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "F:\\Documents\\SED\\Appli\\Demo\\node_modules\\gulp-sass\\node_modules\\node-sass\\node_modules\\pangyp\\bin\\node-gyp" "rebuild"
gyp ERR! cwd F:\Documents\SED\Appli\Demo\node_modules\gulp-sass\node_modules\node-sass
gyp ERR! node -v v4.0.0
gyp ERR! pangyp -v v2.3.2
gyp ERR! not ok
Build failed
[email protected] node_modules\gulp-sass
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected].

enter code here

Thanks for your help.

2
  • run sduo npm install node-sass and then again do sass setup to your project. Commented Sep 13, 2015 at 17:37
  • I did it and when I ran ionic setup sass, I got the same errors Commented Sep 13, 2015 at 18:02

8 Answers 8

4

This (workaround) worked form me and fixed all.

Starting with this setup:

Cordova CLI: 5.3.3 Gulp version: CLI version 3.9.0 Gulp local: Local version 3.9.0 Ionic Version: 1.1.0 Ionic CLI Version: 1.6.5 Ionic App Lib Version: 0.3.9 ios-deploy version: Not installed ios-sim version: 5.0.1 OS: Mac OS X Yosemite Node Version: v4.1.1 Xcode version: Xcode 6.4 Build version 6E35b

I've found a way to avoid to use 'sudo' command. We need before to fix npm permissions following this: https://docs.npmjs.com/getting-started/fixing-npm-permissions and fixing permissions for Node here: http://mawaha.com/permission-fix-node-js/ After this we can check and reinstall software without 'sudo' for npm, n or ionic.

I followed this step:

npm install -g n
rm -R node_modules/ 
npm install [email protected] 
npm -g install node-gyp@3
npm uninstall gulp-sass
npm install gulp-sass@2 
npm rebuild node-sass 
ionic setup sass 

Why [email protected]? Because it works with latest ionic version: https://github.com/driftyco/ionic/pull/4449

Sign up to request clarification or add additional context in comments.

2 Comments

or you can try this
it's the same link in my post :-) but I suggest to avoid 'sudo' command for npm and ionic
2

First uninstall gulp-sass

--> npm uninstall gulp-sass

Install new version

--> npm install gulp-sass@2

Comments

1

I faced the same issue. The way I got it resolved was to first install gulp-sass as:

npm install -g gulp-sass

then went to the project directory to install node dependencies as:

npm install

Then, finally ran:

ionic setup sass

Success! This did the trick for me.

Comments

0

That URL that's 404'ing:

https://raw.githubusercontent.com/sass/node-sass-binaries/v2.1.1/win32-x64-node-4.0/binding.node

Is being generated from lib/extensions.js as such:

function getBinaryName() {
  var binaryName;

  if (flags['--sass-binary-name']) {
    binaryName = flags['--sass-binary-name'];
  } else if (process.env.SASS_BINARY_NAME) {
    binaryName = process.env.SASS_BINARY_NAME;
  } else if (pkg.nodeSassConfig && pkg.nodeSassConfig.binaryName) {
    binaryName = pkg.nodeSassConfig.binaryName;
  } else {
    binaryName = [process.platform, '-',
                  process.arch, '-',
                  process.versions.modules].join('');
  }

  return [binaryName, 'binding.node'].join('_');
}

Indeed the file does not exist in the repo, so I'm guessing the thing that's gone wrong here is that none of those other ifs came true, and so it fell down to that URL as a last-resort.

We can probably fix this by ensuring that the SASS_BINARY_NAME environment variable is set, or passing in the flag. I don't have time to debug this any further myself today!! Good luck, interwebs.

Comments

0

I downgrade the version of nodeJs and it solved my problem I use the V0.12.7

Comments

0

It could be a dependency hell problem with an older NodeJS or NPM version, because older versions of gulp-sass and node-sass do not work with NodeJS version >= 4, see for example https://github.com/sass/node-sass/issues/1166

Comments

0

The solution of @Francesco worked fine with me.

But I just needed one more step: downgrade node.js to the version 0.12.7.

And also to add sudo to the global command lines.

So recapping this is what I had to do:

sudo npm install -g n
n 0.12.7
rm -R node_modules/ 
npm install [email protected] 
sudo npm -g install node-gyp@3
npm uninstall gulp-sass
npm install gulp-sass@2 
npm rebuild node-sass 
ionic setup sass
ionic serve

You can now modify the file scss/ionic.app.scss and check it out.

3 Comments

Was posting a new answer really necessary? The OP already posted an answer stating that they needed to downgrade specifically to 0.12.7.
I felt necessary to take the time to write because the accepted answer was not enough for me. The @francesco solution was good. But it didn't include the downgrade step. So i thought it may be useful for others.
It's not necessary to summarize the other answers. All of the information is already here, this answer is redundant.
0

Do the following step

Edit your package.json. Change:

"gulp-sass": "^2.?.?"

to

"gulp-sass": "3.0.0"

remoce the node_modules folder and run npm install again.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.