Freyskeyd / generator-laravel

Get the power of yeoman with laravel. Manage Grunt, Bower, Tests and many stuff like a boss.
http://freyskeyd.github.io/
MIT License
77 stars 4 forks source link

Unhandled 'error' event #1

Open 66beta opened 11 years ago

66beta commented 11 years ago

Windows 7 32bit with PowerShell. yo webapp works fine.

PowerShell> yo laravel:install C:\Users\66beta\Desktop\myo
[?] Are you sure about cleaning and installing in ./?: Yes
events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: spawn ENOENT
    at errnoException (child_process.js:980:11)
    at Process.ChildProcess._handle.onexit (child_process.js:771:34)
Freyskeyd commented 11 years ago

Hey,

This version isn't fully compatible with windows. Did you have "Composer" command line tool installed?

66beta commented 11 years ago

composer works fine.

Freyskeyd commented 11 years ago

Hey,

Did you have this error again with last release?

Thank's

teeli commented 10 years ago

I'm getting a similar error on Windows 8. I have composer installed and it works fine (and laravel works fine iwth it)

E:\Projects\test\yeoman\laravel>yo laravel                                                             

   ____                                                                                                
   \   \                   _____________________                                                       
    \   \      ____       |  Laravel tools      |                                                      
     \   \     \   \      |                     |                                                      
      \___\_____\___\     |_____________________|                                                      
            \     \                                                                                    
             \_____\                                                                                   
[?] What would you like to do? Install a new Laravel                                                   
[?] Where to install? ./                                                                               
[?] Are you sure about cleaning and installing in ./?: Yes                                             
     info Start cleaning directory (./)                                                                
     info Cleaning done                                                                                
     info Check composer install                                                                       

events.js:72                                                                                           
        throw er; // Unhandled 'error' event                                                           
              ^                                                                                        
Error: spawn ENOENT                                                                                    
    at errnoException (child_process.js:980:11)                                                        
    at Process.ChildProcess._handle.onexit (child_process.js:771:34)                                   

E:\Projects\test\yeoman\laravel>                                                                       
Freyskeyd commented 10 years ago

hey,

I think it's a windows PATH problem.

child_process.spawn ignores PATHEXT on Windows = https://github.com/joyent/node/issues/2318

isimmons commented 10 years ago

Yeah looks like that is the guilty culprit since composer is a .bat file on windows.I don't know much about node but would have thought the node devs could fix that easily until reading through all those issues.

Maybe add a note to the readme for now that it won't work on windows so we don't install it and then have to uninstall it because it can't work?

Cool thing is it's no big deal to install Laravel via command line as normal, then cd into the public dir and use yo to install webapp, backbone, angular or what ever. Those all seem to work fine for me and I guess it's because none of them are having to run a bat file.

isimmons commented 10 years ago

@Freyskeyd On windows 7 here. Just worked around this.

  1. downloaded bat to exe converter http://www.f2ko.de/programs.php?lang=en&pid=b2e
  2. made backup copy of composer.bat
  3. changed in composer.bat "%~dp0composer.phar" to "C:\ProgramData\Composer\bin\composer.phar" Won't work with "%~dp0" needs full path and this is the default if composer is installed with the windows installer

I tried other free converters but this is the only one that made a working exe. I also tested the exe with the regular composer create-project laravel/laravel and self-update commands and all seems to be working correctly.

So to be sure, at the moment this generator doesn't actually install any grunt or bower right? It installed laravel just fine with the above fix but then stopped after that.

clearbucketLabs commented 10 years ago

Darn, same issue here. i guess i'll use a linux VM for this stuff for now anyway...

jeroenherczeg commented 10 years ago

I have the same issue on Win7 But will be switching to linux soon.

brunowego commented 10 years ago

I have the same issue on Win8.1

Freyskeyd commented 10 years ago

I don't have any WinX to work on this issue.

I think it's a node issue.

jamesblackwell commented 10 years ago

Just got this exact error on Mac

Freyskeyd commented 10 years ago

Can you tell me some informations:

Thank's

Le 26 janv. 2014 à 01:15, James Blackwell notifications@github.com a écrit :

Just got this exact error on Mac

— Reply to this email directly or view it on GitHub.

Sunny-fr commented 10 years ago

Hi Simon, I've the same exact issue using osx : here's my setup osx : 10.9.1 node : v0.10.11 (and i also tried on v0.10.25)

Thanks a lot

Freyskeyd commented 10 years ago

Okey,

You get it when you define a relative path to the install?

Can you post the full command output?

Thank's

Sunny-fr commented 10 years ago

yeah, of course : I tried both full path, relative path :

MacBook-Pro-de-Sunny:laravel sunny$ node --version
v0.10.25
MacBook-Pro-de-Sunny:laravel sunny$ yo laravel

   ____
   \   \                   _____________________
    \   \      ____       |  Laravel tools      |
     \   \     \   \      |                     |
      \___\_____\___\     |_____________________|
            \     \
             \_____\
[?] What would you like to do? Install a new Laravel
[?] Where to install? ./
[?] Are you sure about cleaning and installing in ./?: Yes
     info Start cleaning directory (./)
     info Cleaning done
     info Check composer install

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: spawn ENOENT
    at errnoException (child_process.js:988:11)
    at Process.ChildProcess._handle.onexit (child_process.js:779:34)
Freyskeyd commented 10 years ago

Mmmh ok i reproduce when composer is not install globaly

Sunny-fr commented 10 years ago

I reinstalled composer (and double checking -g args :) ) but i've got still the same issue.:(

Freyskeyd commented 10 years ago

Ok, when you:

$ composer

What are you seeing?

Sunny-fr commented 10 years ago

my bad, composer seems missing ! (I installed it using npm )

-bash: composer: command not found
Freyskeyd commented 10 years ago

To install a correct composer you need to use:

curl -sS https://getcomposer.org/installer | php
$ mv composer.phar /usr/local/bin/composer
Sunny-fr commented 10 years ago

Thanks a lot for your time, everything works fine now !

[?] What would you like to do? Install a new Laravel
[?] Where to install? ./
[?] Are you sure about cleaning and installing in ./?: Yes
     info Start cleaning directory (./)
     info Cleaning done
     info Check composer install
     info Composer has been found
Freyskeyd commented 10 years ago

Nop, i think this issue is due to a misunderstanding of composer instalation.

Freyskeyd commented 10 years ago

You can contribute if you want !

Sunny-fr commented 10 years ago

Thank you :) I'm quite new to yeoman :) as soon as i'll get into it, it would be a pleasure :)

//bonne soirée !

jamesblackwell commented 10 years ago

Sorry for the slow reply! I just renamed composer.phar to composer and it all works. Silly mistake as always, thanks for your help.

vinizinmoraes commented 10 years ago

Created a pull request (https://github.com/Freyskeyd/generator-laravel/pull/11) to fix this issue on Windows.

indvinoth commented 10 years ago

I am getting the same error on Windows 8, with working composer installation. Can someone please help me out?