npm just won't install node sass

旧巷老猫 提交于 2019-12-05 08:06:51

I just came across the same problem. It was solved by installing Python v2.7 in C:\Python27\ . (I previously only had Python 3.6 installed in C:\Program Files\Python36\ )

it looks like compatibility issue of the node-sass module. You can solve this issue by following a few steps.

give the below command in your terminal

node list node-sass

It will list all your node-sass dependencies( including nested dependencies)

check all versions of node sass and also check supported node-sass for Node.js installed in your machine

You can either change the Node.js version in your machine or add the following code in package.json

    "resolutions": {
        "*/node-sass": "*"
     },

Remove node_module folder and yarn.lock file (assuming that you use yarn) once you make the above change.

Install the node_modules using yarn install

If you prefer npm instead of yarn you might need to install an additional package called npm force resolutions

I had this issue for days looking for possible answers. I downgraded my node.js from 9.3.0 to v6.12.2 and run (all errors were gone):

        npm update

Hopefully, this can help some of you who have encountered similar errors.

I have resolved this issue by changing compatible version of node.

It may be problem of compatibility of node version with node-sass version you are using. Please check the below document to see the compatibility table and install appropriate node version.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!