Running cake task doesn't work #82

Closed
FredyC opened this Issue Jul 31, 2013 · 11 comments

Comments

Projects
None yet
4 participants
Contributor

FredyC commented Jul 31, 2013

I want to do simple thing. I created Cakefile with the follwing content:

fs = require 'fs'

{print} = require 'sys'
{spawn} = require 'child_process'

task 'watch', 'Watch for changes and compile to out/', ->
  coffee = spawn 'coffee.cmd', ['-c', '-b', '-m', '-w', '-o', 'out', '.']
  coffee.stderr.on 'data', (data) ->
    process.stderr.write data.toString()
  coffee.stdout.on 'data', (data) ->
    print data.toString()

Now within Sublime Text I run command Coffee: Run Cake Task and fill in the watch. Nothing happens and console gives me this:

Traceback (most recent call last):
  File ".\CoffeeScript.py", line 225, in finish
  File ".\CoffeeScript.py", line 74, in cake
  File ".\CoffeeScript.py", line 41, in run
  File ".\subprocess.py", line 633, in __init__
  File ".\subprocess.py", line 842, in _execute_child
WindowsError: [Error 267] The directory name is invalid

I am not python developer, so it's hard for me to debug this. That error message is rather generic to be able to find anything. Any hint what could be causing this ?

Owner

aponxi commented Aug 2, 2013

Two Three things might help debug this:

  • your operating system?
  • sublime text 3? Because ST2 is being depricated even though there is a ST2 branch for this
  • installed by package manager? <- I ask this because the other day I upgraded via package manager and shortcut keys nor the command pallet didn't work (maybe nothing worked but the syntax highlighter). I normally just download the zip file and put it under plugins.
Contributor

FredyC commented Aug 2, 2013

  • Windows 7 64bit
  • Sublime Text 2.0.2 ... I might try ST3 today, didn't knew it's already recommended to use since it's still in beta.
  • Yes, I install everything through package manager. Edit: Tried to install manually, but didn't helped.
Owner

aponxi commented Aug 2, 2013

Btw I have discovered that if we restart ST3 after we install the package via package manager, everything works fine!

Contributor

FredyC commented Aug 21, 2013

So I tried ST3 finally and it's broken there too... Not sure what could be causing this.

Traceback (most recent call last):
  File "X/subprocess.py", line 1090, in _execute_child
NotADirectoryError: [WinError 267] The directory name is invalid

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "CoffeeScript in D:\Sublime\Data\Installed Packages\Better CoffeeScript.sublime-package", line 237, in finish
  File "CoffeeScript in D:\Sublime\Data\Installed Packages\Better CoffeeScript.sublime-package", line 74, in cake
  File "CoffeeScript in D:\Sublime\Data\Installed Packages\Better CoffeeScript.sublime-package", line 41, in run
  File "X/subprocess.py", line 818, in __init__
  File "X/subprocess.py", line 1096, in _execute_child
NotADirectoryError: [WinError 267] The directory name is invalid
Collaborator

lavrton commented Aug 24, 2013

Tested on st3 win32. Everything works. But also I found the bug - plugin is waiting until cake task is done, but if we have task as "watch", it will freeze ST.

Owner

aponxi commented Aug 24, 2013

Sounds dangerous... maybe a new method would be better to run such things... I say spawning a new process could solve this, that way it would run on its own asynchronously.

Collaborator

lavrton commented Aug 26, 2013

Can someone reproduce subj bug?

I think that using plugin or sublime run command for tasks as "watch" is bad idea. It is hard to stop such tasks.

Cake tasks now should not freeze ST.

Contributor

FredyC commented Aug 26, 2013

I agree and I tried running it without watch switch, but result is the same. Maybe it's something in my local setup, that is causing it. Too bad, there is not more information about that error. Like when it says invalid directory name, it would be nice to know, which directory is invalid.

Anyway I am using Grunt now, so cake doesn't bother me anymore. If nobody else has the issue, it can be probably ignored.

Wezea commented Aug 26, 2013

I also get this "The directory name is invalid" error while executing a cake task. Actually, i've got only one task called build in my Cakefile which is located in the root folder, beside the .sublime-project. I connected the build command to this task like that:

 "windows":
  {
     "cmd": ["cake.cmd", "build"]
  }

The funny thing is, the build command is working, but if i try running the cake task build manually i get this

Exception in thread Thread-18:
Traceback (most recent call last):
  File "X/subprocess.py", line 1090, in _execute_child
NotADirectoryError: [WinError 267] The directory name is invalid
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "X/threading.py", line 639, in _bootstrap_inner
  File "X/threading.py", line 596, in run
  File "CoffeeScript in C:\Program Files\Sublime Text 3\Packages\Better CoffeeScript.sublime-package", line 41, in 
  File "CoffeeScript in C:\Program Files\Sublime Text 3\Packages\Better CoffeeScript.sublime-package", line 55, in _run
  File "X/subprocess.py", line 818, in __init__
  File "X/subprocess.py", line 1096, in _execute_child
NotADirectoryError: [WinError 267] The directory name is invalid

ST3
Windows 7 64bit

Owner

aponxi commented Aug 26, 2013

The other day I saw an error message like that as well... But it wasn't in sublime, it was in phpstorm. I found that this being caused by nodejs fresh installment... I restarted (updating the envars or the equivalent of it in windows) and it fixed itself. Don't think this is what you guys are experiencing since clearly you haven't just installed nodejs. But just out of curiosity, does the cake task run on its own outside sublime?

If so, what if the problem is about envars or binary path of node? Binary path of node is important since coffee compiler needs node (or so I thought since the error I got said coffee couldn't find node).

Collaborator

lavrton commented Aug 27, 2013

Fixed via 4e13239
Test it! Reopen if need.

lavrton closed this Aug 27, 2013

zhengbli referenced this issue in Microsoft/TypeScript-Sublime-Plugin Jun 16, 2015

Open

ERROR: can not send request; node process not running #235

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment