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

各种报错 #1

Open
aduo1021 opened this issue Jun 3, 2017 · 4 comments
Open

各种报错 #1

aduo1021 opened this issue Jun 3, 2017 · 4 comments

Comments

@aduo1021
Copy link

aduo1021 commented Jun 3, 2017

亲,你这个运行不了啊,各种报错

@Panda-Hope
Copy link
Owner

您能把详细报错粘贴一下,让我看看吗,我看下什么问题,我这边正常运行的哦

@aduo1021
Copy link
Author

aduo1021 commented Jun 3, 2017

image
很多类似这种错误

@aduo1021
Copy link
Author

aduo1021 commented Jun 3, 2017

image
这个东西s是干什么的啊?下不动

@Panda-Hope
Copy link
Owner

首先这里说个抱歉,在跨平台上安装有所考虑不周。
折腾到现在终于解决了这个问题,这个问题主要是由于在windows下node-sass的安装问题导致的,从零开始做个简介:
1: 原有的packages里面的包比较大确实会出现下载途中中断这种现象,我已经删除了一些vue-cli中没有用到的依赖包来减轻总体的大小,但是有的时候还是会出现卡住,这里主要可以通过修改npm的配置来进行一些加速
一:关闭npm的https
npm config set strict-ssl false
二:设置npm的获取地址
npm config set registry "http://registry.npmjs.org/"
关于npm加速详情可以看这篇文章https://cnodejs.org/topic/53330242edf0031c2c00ca81

核心问题:
这里错误的核心点在于node-sass的安装问题,目前我已经在windows下测试OK已经解决了这个问题
首先这里需要先卸载掉原有的node-sass 模块
npm uninstall node-sass --save
这里主要的原因是在于node模块的二进制编译相对node版本和操作系统的问题详情可以看下这里
sass/node-sass#1387
重点!!!重点!!!重点!!!
然后你需要找到你的nodejs目录然后搜索打开.npmrc文件然后在里面添加这么一行代码SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/
然后在重新安装 node-sass
npm install node-sass --save-dev
然后在重新输入 npm run dev 你就会发现项目就可以运行了,如果还有一些其他的问题,可以继续留言。

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