【发布时间】:2016-06-03 13:48:52
【问题描述】:
我正在尝试让gulp-scss-lint 在我的机器上工作,但这样做时遇到了麻烦。
上下文
我感觉特定版本和环境设置可能对我的问题很重要,所以让我列出我的特定上下文:
- Windows Server 2012 R2 标准版
- NPM 2.14.7
- 节点 4.2.2
- 已安装 Gulp 3.9.0
-g - 从 Powershell 4.0 运行
复制
这是我的问题的重现:
-
mkdir gulpscsslint和cd gulpscsslint -
npm init包含所有默认答案 npm install gulp --save-devnpm install gulp-scss-lint --save-dev-
new-item -itemtype file gulpfile.js并输入:var gulp = require('gulp'), lint = require('gulp-scss-lint'); gulp.task('default', [], function() { return gulp.src('*.scss').pipe(lint()); }); new-item -itemtype file styles.scssgulp
结果:
[08:48:50] Using gulpfile ~\experiments\gulpscsslint\gulpfile.js [08:48:50] Starting 'default'... [08:48:50] 'default' errored after 32 ms [08:48:50] Error in plugin 'gulp-scss-lint' Message: Error code 1 Error: Command failed: C:\Windows\system32\cmd.exe /s /c "scss-lint 'styles.scss' --format=JSON" 'scss-lint' is not recognized as an internal or external command, operable program or batch file.
预期的结果显然是 linter 的实际输出。
然后我继续:
npm install scss-lint --save-dev
但它失败了failNoPython,输出中的这个sn-p:
Can not download file from https://raw.githubusercontent.com/sass/node-sass-binaries/v2.1.1/win32-x64-node-4.2/binding.node gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable
问题
Python 安装这个 Node 包真的是硬性要求吗?还是可以在不安装 Python 的情况下以某种方式安装它?
作为脚注,既然我已经完整地写了这个问题,我意识到这可能更像是一个 Github 问题,但如果是这样,我可能需要一些帮助(学习如何)find( ing)找出什么包或工具给我带来了麻烦(gulp-scss-lint?scss-lint?npm?node-sass 或其他一些底层包?)。
【问题讨论】:
标签: npm gulp node-sass scss-lint