node-sass installation issue

后端 未结 7 1329
清酒与你
清酒与你 2021-01-04 10:57

When I try to install node-sass using npm, I get the following error message:

Cannot download \"https://github.com/sass/node-sass/releases/download/v3

相关标签:
7条回答
  • 2021-01-04 11:30

    Depends on which node version you are using. Node-Sass currently supports only these versions:

    Supported Node.js versions 0.10, 0.12, 1, 2, 3, 4, 5, 6 and 7.

    If you happen to work on one of those versions, try to specify which version of node-sass you want:

    $ npm install --save-dev node-sass@4.5.3
    

    your npm is trying to download node-sass version 3.31.1 which is does not exist on the releases page of https://github.com/sass/node-sass/releases

    0 讨论(0)
  • 2021-01-04 11:35

    While searching for the solution, have checked the release versions of node-sass and found that "https://github.com/sass/node-sass/releases" the node file it was looking is committed in the latest release and not in the older version. After downloading the required file "win32-x64-64_binding.node" manually from the released version and placing it under C:\Users\Administrator\AppData\Roaming\npm-cache\node-sass\4.7.2 or simply by using npm install node-sass@latest works for me.

    0 讨论(0)
  • 2021-01-04 11:36

    My problem is, that I need an older node-sass Binary, which is not available for the new node version I have. But the solution is, at least on Windows, pretty simple. Just install the windows build tools. With that, npm is able to build the binaries out of the source.

    Long story short, this solved the problem for me:

    npm install --global --production windows-build-tools
    

    Thanks to the answer on this question: node-sass installation issue on windows 10

    0 讨论(0)
  • 2021-01-04 11:42

    You have an error on your command:

    $ npm install node-sass --save-dev-
                                     ^^^
    

    Should be

    $ npm install node-sass --save-dev
    

    (without the last - on dev)

    Also, it is giving you a WARNING because it wants to be installed globally.

    See the official node-sass documentation.

    And also, could be interesting for you to know the differences between --save and --save-dev.

    0 讨论(0)
  • 2021-01-04 11:44

    After struggling , finally found exact solution. In node js software folder, node-sass\4.5.0 folder is still created in npm-cache folder. So I download win32-x64-48_binding.node manually, put it in C:\Users\Administrator\AppData\Roaming\npm-cache\node-sass\4.5.0 folder.

    And run npm install command, issue resolved.

    0 讨论(0)
  • 2021-01-04 11:48

    None of the above solutions worked for me, this is what I did:

    Installed C++ build tools for Visual Studio

    Then:

    npm uninstall --save-dev gulp-sass
    
    0 讨论(0)
提交回复
热议问题