我正在尝试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-dev
npm 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.scss
gulp
结果:
[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
,输出中的这个片段:
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 问题,但如果是这样,我可能需要一些帮助(学习如何)找出什么包或工具给了我麻烦(gulp-scss-lint
? scss-lint
? npm
?node-sass
或其他一些底层包?)。