Try reinstalling `node-sass` on node 0.12?

前端 未结 17 2647
感情败类
感情败类 2020-12-02 04:04

I would like to use google web starter kit. I installed node.js v0.12.0, node-sass & gulp.

And then ran:

$ sudo npm ins         


        
相关标签:
17条回答
  • 2020-12-02 04:19

    I found this useful command:

    npm rebuild node-sass
    

    From the rebuild documentation:

    This is useful when you install a new version of node (or switch node versions), and must recompile all your C++ addons with the new node.js binary.

    http://laravel.io/forum/10-29-2014-laravel-elixir-sass-error

    0 讨论(0)
  • 2020-12-02 04:19

    I ran into this error using node 0.12.0 and it was fixed by deleting the existing /node_modules directory and running npm update.

    0 讨论(0)
  • 2020-12-02 04:20

    You need to use the right version. Try:

    nvm use 0.12
    
    0 讨论(0)
  • 2020-12-02 04:22

    My issue was that I was on a machine with node version 0.12.2, but that had an old 1.x.x version of npm. Be sure to update your version of npm: sudo npm install -g npm Once that is done, remove any existing node-sass and reinstall it via npm.

    0 讨论(0)
  • 2020-12-02 04:23

    I had the same issue as @Kos had, only for some reason I had to modify the gulp-sass package from the old package.json file I had. It then installed the dependencies currently and now it finally works!

    0 讨论(0)
  • 2020-12-02 04:27

    This answer is a bit orthogonal to the the OP, but --

    libsass bindings don't install properly with the node-sass wrapper on Node v4.0.0. I got the same error message as in the question (Error: 'libsass' bindings not found. Try reinstalling 'node-sass') but I ended up uninstalling Node v4.0.0 and installing v0.12.7 using nvm, via this script:

    https://gist.github.com/brock/5b1b70590e1171c4ab54

    and now libsass and node-sass are behaving properly.

    0 讨论(0)
提交回复
热议问题