Open m1skam opened 7 years ago
+1 same thing:
Cannot run program "stylelint.cmd"
This should be fixed in the latest from develop, unfortunately I cannot deploy to the plugin repository. Only @niutech can do it. Also, as mentioned in #4, there is a new built-in version of this plugin. You should try checking that out.
I have upgraded the Stylelint plugin in Jetbrains Plugin Repository.
I had the same issue and after updating I have another error:
Could not create stylelint process.: Cannot run program "/stylelint" (in directory "/Users/Bruno/Documents/Workspace/f4s/f4s-website"): error=2, No such file or directory
com.intellij.execution.process.ProcessNotCreatedException: Cannot run program "/stylelint" (in directory "/Users/Bruno/Documents/Workspace/f4s/f4s-website"): error=2, No such file or directory
at com.intellij.execution.configurations.GeneralCommandLine.createProcess(GeneralCommandLine.java:369)
at com.jokerzoid.intellij.plugin.stylelint.ProcessManager.createStylelintProcess(ProcessManager.java:65)
at com.jokerzoid.intellij.plugin.stylelint.ProcessManager.runStylelint(ProcessManager.java:36)
at com.jokerzoid.intellij.plugin.stylelint.StylelintAnnotator.doAnnotate(StylelintAnnotator.java:41)
at com.jokerzoid.intellij.plugin.stylelint.StylelintAnnotator.doAnnotate(StylelintAnnotator.java:19)
at com.intellij.codeInsight.daemon.impl.ExternalToolPass.c(ExternalToolPass.java:212)
at com.intellij.codeInsight.daemon.impl.ExternalToolPass.access$500(ExternalToolPass.java:44)
at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.run(ExternalToolPass.java:160)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:337)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:327)
at com.intellij.util.ui.update.MergingUpdateQueue.lambda$flush$1(MergingUpdateQueue.java:277)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:291)
at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:246)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:223)
at com.intellij.util.Alarm$Request$1.run(Alarm.java:387)
at com.intellij.util.Alarm$Request.run(Alarm.java:398)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:237)
at com.intellij.util.concurrency.BoundedTaskExecutor$2.run(BoundedTaskExecutor.java:210)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Cannot run program "/stylelint" (in directory "/Users/Bruno/Documents/Workspace/f4s/f4s-website"): error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at com.intellij.execution.configurations.GeneralCommandLine.startProcess(GeneralCommandLine.java:379)
at com.intellij.execution.configurations.GeneralCommandLine.createProcess(GeneralCommandLine.java:365)
... 22 more
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
at java.lang.ProcessImpl.start(ProcessImpl.java:134)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 24 more
In my plugin preferences, the enabled checkbox is ticked, the node interpreter is correct, but the stylelint package points to /usr/local/lib/node_modules/stylelint
which is a directory. I've tried to change it to the executable /usr/local/bin/stylelint
but that doesn't work either.
Since there is a mention of it in the release notes, I've also tried to set and unset the environment variable STYLELINT_HOME=/usr/local/bin/
in ~/.bash_profile
but that doesn't help (I've restarted PyCharm after changing).
node v6.2.2 stylelint v7.6.0 and then with latest v7.7.1 stylelint plugin v1.3
Make sure you set the appropriate path in Properties/Settings > Tools > Stylelint. For me under Windows it is: C:\Users\[Username]\AppData\Roaming\npm\stylelint.cmd
.
I'm on OS X El Capitan, having the same issue, tried saving the path, but getting:
11:20:49 ProcessNotCreatedException: Could not create stylelint process.: Cannot run program "/stylelint" (in directory "/Users/…"): error=2, No such file or directory
11:21:23 AbstractMethodError: com.jokerzoid.intellij.plugin.stylelint.ProjectConfigurationPanel.disposeUIResources()V
11:21:23 Unable to save settings: Failed to save settings. Please restart IntelliJ IDEA
Are you sure you have set the right path in this window (there is no such thing as Enabled checkbox)?
Sorry, I cannot help you. I don't have a Mac.
Path looks correct /usr/local/lib/node_modules/stylelint/
, I update the path, then click Apply
and get 11:28:39 Unable to save settings: Failed to save settings. Please restart IntelliJ IDEA
.
I've tried restarting and updating permissions as well, but still getting the error.
There should be a full path, including the executable, equal to the output of which stylelint
(provided that Stylelint was installed globally).
When I do which stylelint
I get:
༼ つ ◕_◕ ༽つ⚡ which stylelint
/usr/local/bin/stylelint
Looks like that's a symlink to /usr/local/lib/node_modules/stylelint/
, however updating the path to /usr/local/bin/stylelint
I now get:
IllegalStateException: This is not a JSON Array.
Full log:
This is not a JSON Array.
java.lang.IllegalStateException: This is not a JSON Array.
at com.google.gson.JsonElement.getAsJsonArray(JsonElement.java:106)
at com.jokerzoid.intellij.plugin.stylelint.ProcessManager.getOutput(ProcessManager.java:79)
at com.jokerzoid.intellij.plugin.stylelint.ProcessManager.runStylelint(ProcessManager.java:42)
at com.jokerzoid.intellij.plugin.stylelint.StylelintAnnotator.doAnnotate(StylelintAnnotator.java:41)
at com.jokerzoid.intellij.plugin.stylelint.StylelintAnnotator.doAnnotate(StylelintAnnotator.java:19)
at com.intellij.codeInsight.daemon.impl.ExternalToolPass.c(ExternalToolPass.java:218)
at com.intellij.codeInsight.daemon.impl.ExternalToolPass.access$500(ExternalToolPass.java:44)
at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.run(ExternalToolPass.java:160)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:337)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:327)
at com.intellij.util.ui.update.MergingUpdateQueue$3.run(MergingUpdateQueue.java:271)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:286)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:244)
at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:234)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
at com.intellij.util.Alarm$Request$1.run(Alarm.java:352)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at com.intellij.util.concurrency.QueueProcessor$RunnableConsumer.consume(QueueProcessor.java:298)
at com.intellij.util.concurrency.QueueProcessor$RunnableConsumer.consume(QueueProcessor.java:295)
at com.intellij.util.concurrency.QueueProcessor$2$1.run(QueueProcessor.java:110)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
at com.intellij.util.concurrency.QueueProcessor$2.consume(QueueProcessor.java:107)
at com.intellij.util.concurrency.QueueProcessor$2.consume(QueueProcessor.java:104)
at com.intellij.util.concurrency.QueueProcessor$3$1.run(QueueProcessor.java:215)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
at com.intellij.util.concurrency.QueueProcessor$3.run(QueueProcessor.java:212)
at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:366)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:55)
Ah, there are 2 section for "stylelint", one under "Languages & Frameworks >...", which isn't the one for this plugin, and one under tools... My mistake. I have the same error as @s10wen when using the correct setting though.
This looks like a Stylelint issue. Try running stylelint -f json [yourfile]
in the console. What is the output?
@niutech works as expected (tried with json
as well).
Example of outpout with stylelint -f json
[
{
"source": "/Users/Bruno/Documents/Workspace/f4s/f4s-website/fe-src/sass/common/_animations.scss",
"deprecations": [],
"invalidOptionWarnings": [],
"errored": true,
"warnings": [
{
"line": 2,
"column": 3,
"rule": "indentation",
"severity": "error",
"text": "Expected indentation of 1 tab (indentation)"
}
]
}
]
I've checked the JSON you provided, it is valid and com.google.gson.JsonElement.getAsJsonArray()
succeeds. Probably there was some problem with reading output of Stylelint into Java, but I can't help because I don't have a Mac.
@s10wen @browniebroke Thank you for taking the time to test this. First of all that exception is usually thrown when the Stylelint executable returns something different than JSON. The most common error happens when it cannot find the configuration file. When the command executes it sets the root of the project as the working directory. Then stylelint tries to find the configuration file using the rules described in: https://github.com/stylelint/stylelint/blob/master/docs/user-guide/configuration.md.
As a side note, I thought of stopping working on this because of the build-in plugin now provided under Languages. But I guess I can show a better description message for this specific scenario (unless someone beat me to it.)
Thanks for this update. Thanks for the effort at trying to beat Jetbrains at it!
I've disabled this plugin and switched to the built-in one. It appears to not yet work with stylelint > 7.6 though, so I had to run npm install -g stylelint@7.6.0
.
There was a ticket on Youtrack for this, the fix should propagate in coming IDEs version.
@browniebroke how did you switch to the built-in one please?
Go to settings, search for "stylelint" (1). If you have Jardinero's plugin installed it'll show up under "Tools", like me at the very bottom. The built-in one is under "Languages & Framework" (2) - at least in PyCharm.
Go to that one and enable it (3). Make sure your node executable and your stylelint package are found. Stylelint >7.6 is only supported from 2017.1 InetlliJ editors.
@browniebroke thanks for the reply, I can't see 'settings', but in preferences, I can see Jardinero's plugin, but I can't see 'Stylesheets' under 'Languages & Framework'. Any ideas please?
@browniebroke checking you saw the last comment please and if you can offer any further advice?
Hum strange... I don't know any more, but in case that's relevant, I'm using PyCharm professional (not the community edition):
PyCharm 2016.3.2 Build #PY-163.10154.50, built on December 28, 2016
If the problem persists, maybe check with JetBrains?
I got this working with the Jet Brains version, needed an update.
no chance here do enable it :(
Why can't this be correctly enabled by default on a Mac?
Same issue here while make the configuration for a Prettier watcher combined to stylelint. Had to install stylelint globally first and now I'm getting :
ExternalToolPass:
com.intellij.diagnostic.PluginException: annotator: com.jokerzoid.intellij.plugin.stylelint.StylelintAnnotator@4a2c2876 (class com.jokerzoid.intellij.plugin.stylelint.StylelintAnnotator) [Plugin: com.jokerzoid.intellij.plugin.stylelint]
at com.intellij.ide.plugins.PluginManagerCore.createPluginException(PluginManagerCore.java:368)
at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:12)
at com.intellij.diagnostic.PluginException.createByClass(PluginException.java:68)
at com.intellij.codeInsight.daemon.impl.ExternalToolPass.process(ExternalToolPass.java:243)
at com.intellij.codeInsight.daemon.impl.ExternalToolPass.doAnnotate(ExternalToolPass.java:195)
at com.intellij.codeInsight.daemon.impl.ExternalToolPass.access$600(ExternalToolPass.java:41)
at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.lambda$run$1(ExternalToolPass.java:166)
at com.intellij.openapi.progress.util.BackgroundTaskUtil.lambda$runUnderDisposeAwareIndicator$10(BackgroundTaskUtil.java:243)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$3(CoreProgressManager.java:180)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:164)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:586)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:532)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:86)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:151)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:180)
at com.intellij.openapi.progress.util.BackgroundTaskUtil.runUnderDisposeAwareIndicator(BackgroundTaskUtil.java:263)
at com.intellij.openapi.progress.util.BackgroundTaskUtil.runUnderDisposeAwareIndicator(BackgroundTaskUtil.java:242)
at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.run(ExternalToolPass.java:165)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:336)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:326)
at com.intellij.util.ui.update.MergingUpdateQueue.lambda$flush$1(MergingUpdateQueue.java:276)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:290)
at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:245)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:232)
at com.intellij.util.Alarm$Request.runSafely(Alarm.java:368)
at com.intellij.util.Alarm$Request.run(Alarm.java:355)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:224)
at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:220)
at com.intellij.util.concurrency.BoundedTaskExecutor.access$100(BoundedTaskExecutor.java:26)
at com.intellij.util.concurrency.BoundedTaskExecutor$2.lambda$run$0(BoundedTaskExecutor.java:198)
at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:224)
at com.intellij.util.concurrency.BoundedTaskExecutor$2.run(BoundedTaskExecutor.java:194)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: Not a JSON Array: null
at com.google.gson.JsonElement.getAsJsonArray(JsonElement.java:107)
at com.jokerzoid.intellij.plugin.stylelint.ProcessManager.getOutput(ProcessManager.java:79)
at com.jokerzoid.intellij.plugin.stylelint.ProcessManager.runStylelint(ProcessManager.java:42)
at com.jokerzoid.intellij.plugin.stylelint.StylelintAnnotator.doAnnotate(StylelintAnnotator.java:41)
at com.jokerzoid.intellij.plugin.stylelint.StylelintAnnotator.doAnnotate(StylelintAnnotator.java:19)
at com.intellij.codeInsight.daemon.impl.ExternalToolPass.doAnnotate(ExternalToolPass.java:192)
... 32 more
Any workaround to get it work ?
Apparently in the last version of Intellij Idea (using the 2019.1.x) Stylelint plugin is useless and cause conflict with Prettier in Mac OS env.
FYI: my issue has been fixed by setting the file type of my SASS watcher to any instead of SASS for pointing to my .scss files. You can then define a scope for the watcher pointing to the .scss files.
Hope it helps
Could not create stylelint process.: Cannot run program "stylelint.cmd" (in directory "/Users/user/projects/projectname"): error=2, No such file or directory
macOS Sierra