Install scss-lint with npm without Python

I am trying to get gulp-scss-lint to work on my machine, but I have problems with this.

Context

I have a feeling that specific versions and environment settings are important to my problem, 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
  • Works with Powershell 4.0

Repro

Here's my problem reproduced:

  • mkdir gulpscsslint and cd gulpscsslint
  • npm init with all default answers
  • npm install gulp --save-dev
  • npm install gulp-scss-lint --save-dev
  • 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()); }); 
  • new-item -itemtype file styles.scss

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

The expected result was, obviously, the actual exit from linter.

So, 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 hard to install Python this Node package? Or can I somehow install it without installing Python?

As a footnote, now that I have completely written this question, I understand that this may be something more than a Github problem, but if so, I may need some help (learn how) to find some kind of package or tool ( gulp-scss-lint ? scss-lint ? npm ? node-sass or some other basic package?).

+5
source share
1 answer

You can manually install the package by cloning or downloading it directly from the github repository and putting it in the right place.

Remarks:

node-gyp is a cross-platform command line tool written in Node.js to compile its own add-on 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 windows-build-tools package, which includes python, to use node-gyp.

0
source

Source: https://habr.com/ru/post/1243558/


All Articles