Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Win 7 下安装 node-sass 失败解决方法 #31

Open
shiiiiiiji opened this issue Jun 26, 2018 · 2 comments
Open

Win 7 下安装 node-sass 失败解决方法 #31

shiiiiiiji opened this issue Jun 26, 2018 · 2 comments

Comments

@shiiiiiiji
Copy link
Owner

shiiiiiiji commented Jun 26, 2018

本机环境:Window 7

其实因为antd-mobile依赖了node-sassnode-gyp包,安装 node-sass 的正确姿势,正确安装后一般都没什么问题。

但是在本机还遇到一下问题,将解决方法记录下来:

1、缺少Python
image

解决方案:安装Python后执行如下命令(替换为自己电脑的路径):

npm config set python C:\Programs\Python27\python.exe

2、
image

解决方案:下载.Net Framework后安装后重启电脑生效。(仅安装这个没用)
解决方案:参照npm install socket.io 提示缺少“VCBuild.exe”,一定要装VS C++吗?

看答案里有一个比较简单的方法是:
nodejs/node-gyp#307 (comment)

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

3、
image

看到报错觉得可能是node_modules的问题,然后就;

rm -rf node_modules

成功啦!不容易~

image

MAC大法好!

@shiiiiiiji shiiiiiiji changed the title 无法安装antd-mobile解决方法 win7下无法安装node-sass解决方法 Jun 26, 2018
@shiiiiiiji shiiiiiiji changed the title win7下无法安装node-sass解决方法 Win 7 下无法安装node-sass解决方法 Jun 26, 2018
@shiiiiiiji shiiiiiiji changed the title Win 7 下无法安装node-sass解决方法 Win 7 下无法安装 node-sass 失败解决方法 Jun 26, 2018
@xinconan
Copy link

xinconan commented Jul 2, 2018

安装node-sass 4.x版本就好了

@shiiiiiiji
Copy link
Owner Author

@xinconan 春哥6

@shiiiiiiji shiiiiiiji added the BUG label Jul 10, 2018
@shiiiiiiji shiiiiiiji changed the title Win 7 下无法安装 node-sass 失败解决方法 Win 7 下安装 node-sass 失败解决方法 Jul 10, 2018
@shiiiiiiji shiiiiiiji removed the BUG label Oct 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants