[已解决][求助]#gulp 出现错误:segmentation fault(core dumped)#
已经重新部署5次,也是出现这个问题
架设环境:
| win 7(32位) |
| Intel core i5 |
| 4 G 内存 |
以下是代码还原
vagrant@homestead:~/Code/sample$ gulp
[09:58:46] Using gulpfile ~/Code/sample/gulpfile.js
[09:58:46] Starting 'default'...
[09:58:46] Starting 'sass'...
Segmentation fault (core dumped) #出现这个问题
| 已经尝试过多种方法,Google,百度过,还是无法解决,望解决办法! |
| 2017 年 1 月 3 日 23:44 解决方法 |
- 删除应用里面的 node_modules 文件夹。
- 配置淘宝 npm 镜像。
$ npm install -g cnpm --registry=https://registry.npm.taobao.org
用 cnpm 重新安装。
$ cnpm install
等待安装完成。
$ downloading
进入应用根目录 (我的是 sample ) ,启动 gulp 。
$ gulp
如果出现以下界面,那就是成功了
[15:43:28] Using gulpfile ~/Code/sample/gulpfile.js
[15:43:28] Starting 'default'...
[15:43:28] Starting 'sass'...
Fetching Sass Source Files...
- resources/assets/sass/app.scss
Saving To...
| 祝大家开发成功! |
关于 LearnKu
试试把node_modules目录删了,重新npm install一下
@leo 好的 感谢!听说npm体验不好(貌似需要开vpn才能用),所以就没有尝试这个方法。
@佛山丰芒 可以配置成淘宝镜像,就不用翻墙了
@leo 非常感谢,正在配置淘宝镜像中!
教程 里面的代码
会出现很多 warning 信息
特别严重的是
通过交流,推断是node-sass的下载验证机制,使到这种下载方式被禁止(@匠心)
而出现上面的情况
是因为运行 gulp 权限不够,输入以下命令就可以看到真正报错原因
真正报错原因就是
vagrant@homestead:~/Code/sample$ sudo gulp [10:43:46] Using gulpfile ~/Code/sample/gulpfile.js [10:43:46] Starting 'default'... [10:43:46] Starting 'sass'... [10:43:47] 'sass' errored after 295 ms [10:43:47] Error: ENOENT: no such file or directory, scandir '/home/vagrant/Code/sample/node_modules/node-sass/vendor' at Error (native) at Object.fs.readdirSync (fs.js:951:18) at Object.getInstalledBinaries (/home/vagrant/Code/sample/node_modules/node-sass/lib/extensions.js:121:13) at foundBinariesList (/home/vagrant/Code/sample/node_modules/node-sass/lib/errors.js:20:15) at foundBinaries (/home/vagrant/Code/sample/node_modules/node-sass/lib/errors.js:15:5) at Object.module.exports.missingBinary (/home/vagrant/Code/sample/node_modules/node-sass/lib/errors.js:45:5) at module.exports (/home/vagrant/Code/sample/node_modules/node-sass/lib/binding.js:15:30) at Object. (/home/vagrant/Code/sample/node_modules/node-sass/lib/index.js:14:35) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) [10:43:47] Error in plugin 'run-sequence(sass)' Message: ENOENT: no such file or directory, scandir '/home/vagrant/Code/sample/node_modules/node-sass/vendor' #注意这个错误 Details: errno: -2 code: ENOENT syscall: scandir path: /home/vagrant/Code/sample/node_modules/node-sass/vendor Stack: Error: ENOENT: no such file or directory, scandir '/home/vagrant/Code/sample/node_modules/node-sass/vendor' at Error (native) at Object.fs.readdirSync (fs.js:951:18) at Object.getInstalledBinaries (/home/vagrant/Code/sample/node_modules/node-sass/lib/extensions.js:121:13) at foundBinariesList (/home/vagrant/Code/sample/node_modules/node-sass/lib/errors.js:20:15) at foundBinaries (/home/vagrant/Code/sample/node_modules/node-sass/lib/errors.js:15:5) at Object.module.exports.missingBinary (/home/vagrant/Code/sample/node_modules/node-sass/lib/errors.js:45:5) at module.exports (/home/vagrant/Code/sample/node_modules/node-sass/lib/binding.js:15:30) at Object. (/home/vagrant/Code/sample/node_modules/node-sass/lib/index.js:14:35) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) [10:43:47] Finished 'default' after 353 ms现在的思路就是先把 node-sass装好。
我还是继续努力排查错误,解决了就在这里发表~当学习日志也可以 ~
感谢@leo @匠心
第一次用Markdown,真好玩~只是大家要洗眼睛而已~哈哈 这混乱的排版