Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing scss-lint with npm without Python

I'm trying to get gulp-scss-lint to work on my machine, but having trouble doing so.

Context

I have a feeling specific versions and environment settings may be important to my issue, so let me list my specific context:

  • Windows Server 2012 R2 Standard
  • NPM 2.14.7
  • Node 4.2.2
  • Gulp 3.9.0 installed -g
  • Running from Powershell 4.0

Repro

Here's a repro of my problem:

  1. mkdir gulpscsslint and cd gulpscsslint
  2. npm init with all default answers
  3. npm install gulp --save-dev
  4. npm install gulp-scss-lint --save-dev
  5. new-item -itemtype file gulpfile.js and enter:

    var gulp = require('gulp'), lint = require('gulp-scss-lint');
    gulp.task('default', [], function() {
      return gulp.src('*.scss').pipe(lint());
    });
    
  6. new-item -itemtype file styles.scss

  7. gulp

Result:

 [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.

Expected result was obviously actual output from the linter.

So then I continued:

  1. npm install scss-lint --save-dev

But it fails with failNoPython, with this snippet from the output:

 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

Question

Is it really a hard requirement to have Python to install this Node package? Or can it somehow be installed without installing Python?

As a footnote, now that I've fully written this question I realize this might be more something of a Github issue, but if so I might need some help (learning how to) find(ing) out what package or tool is giving me trouble (gulp-scss-lint? scss-lint? npm? node-sass or some other underlying package?).

like image 990
Jeroen Avatar asked Nov 08 '22 19:11

Jeroen


1 Answers

You can manually install the package by cloning or downloading it directly from it's github repository and placing it into your targeted location.

Note:

node-gyp is a cross-platform command-line tool written in Node.js for compiling native addon modules for Node.js. Link

This package requires Python to work. Hundreds of packages, including npm and npminstall, rely on node-gyp to compile. On windows, a person can install the package windows-build-tools, which includes python, to use node-gyp.

like image 59
RuHa Avatar answered Nov 28 '22 23:11

RuHa