Try reinstalling `node-sass` on node 0.12?

前端 未结 17 2685
感情败类
感情败类 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:36

    I removed all the /node_modules folder then ran npm install and it worked.

    I have node v5.5.0, npm 3.3.12

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

    I have same issue when gulp-sass version is 1.3.0, and fix it after upgrading to 2.1.0.

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

    For me, this issue was caused in my build system (Travis CI) by doing something kind of dumb in my .travis.yml file. In effect, I was calling npm install before nvm use 0.12, and this was causing node-sass to be built for 0.10 instead of 0.12. My solution was simply moving nvm use out of the .travis.yml file’s before_script section to before the npm install command, which was in the before_install section.

    In your case, it is likely that whatever process you are starting with gulp is using a different version of node (than what you would expect).

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

    I had the same issue:

    • installing node-sass
    • being told at the end of installation that the installation completed successfully
    • then being asked to re-install node-sass.

    The solution is to install node-sass version 2 which supports current versions of node. See https://github.com/sass/node-sass/issues/490#issuecomment-70388754

    Run:

    npm install node-sass@2
    

    Then re-test:

    $ npm ls node-sass
    myapp@0.0.0 /var/www/myapp
    └── node-sass@2.0.1
    
    $ gulp sass
    [09:48:42] Using gulpfile /var/www/myapp/gulpfile.js
    [09:48:42] Starting 'sass'...
    [09:48:42] Finished 'sass' after 15 ms
    
    0 讨论(0)
  • 2020-12-02 04:40

    you may also want to npm remove gulp-sass and re-install gulp-sass if you've switched node versions.

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