kungfusheep / SublimeLinter-contrib-stylelint

this repo is no longer maintained - please see https://github.com/SublimeLinter/SublimeLinter-stylelint
MIT License
116 stars 19 forks source link

Fails with globally installed stylelint #8

Closed jonathantneal closed 8 years ago

jonathantneal commented 8 years ago
sudo npm install -g stylelint # installs stylelint globally
stylelint test.css # tests a file

Later, in the SublimeText console:

SublimeLinter: stylelint output:
module.js:338
    throw err;
          ^
Error: Cannot find module 'meow'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/jonathan/node_modules/stylelint/dist/cli.js:6:13)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10) 

It works fine with a locally installed stylelint, btw.

kungfusheep commented 8 years ago

The plugin still looks for local installs of stylelint even though the CLI support has been added. It was done like that to avoid situations where different projects are using different versions of postcss/stylelint. On Fri, 8 Jan 2016 at 04:59, Jonathan Neal notifications@github.com wrote:

sudo npm install -g stylelint # installs stylelint globally stylelint test.css # tests a file

Later, in the SublimeText console:

SublimeLinter: stylelint output: module.js:338 throw err; ^ Error: Cannot find module 'meow' at Function.Module._resolveFilename (module.js:336:15) at Function.Module._load (module.js:278:25) at Module.require (module.js:365:17) at require (module.js:384:17) at Object. (/Users/jonathan/node_modules/stylelint/dist/cli.js:6:13) at Module._compile (module.js:460:26) at Object.Module._extensions..js (module.js:478:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Function.Module.runMain (module.js:501:10)

— Reply to this email directly or view it on GitHub https://github.com/kungfusheep/SublimeLinter-contrib-stylelint/issues/8.

kenvunz commented 8 years ago

@kungfusheep see my pull request #9 and let me know what you think.

We sometime have projects that don't use npm for package manager at all (hello Wordpress sites) and having npm in just for style linting is rather excessive

kungfusheep commented 8 years ago

all should be sorted now. closing.