generator-laravel icon indicating copy to clipboard operation
generator-laravel copied to clipboard

Unhandled 'error' event

Open 66beta opened this issue 12 years ago • 28 comments
trafficstars

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)

66beta avatar Aug 15 '13 07:08 66beta

Hey,

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

Freyskeyd avatar Aug 15 '13 08:08 Freyskeyd

composer works fine.

66beta avatar Sep 04 '13 07:09 66beta

Hey,

Did you have this error again with last release?

Thank's

Freyskeyd avatar Oct 02 '13 12:10 Freyskeyd

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>                                                                       

teeli avatar Oct 17 '13 12:10 teeli

hey,

I think it's a windows PATH problem.

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

Freyskeyd avatar Oct 17 '13 13:10 Freyskeyd

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 avatar Oct 22 '13 23:10 isimmons

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

isimmons avatar Oct 25 '13 16:10 isimmons

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

clearbucketLabs avatar Nov 07 '13 21:11 clearbucketLabs

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

jeroenherczeg avatar Nov 21 '13 07:11 jeroenherczeg

I have the same issue on Win8.1

brunowego avatar Dec 28 '13 15:12 brunowego

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

I think it's a node issue.

Freyskeyd avatar Jan 04 '14 00:01 Freyskeyd

Just got this exact error on Mac

jamesblackwell avatar Jan 26 '14 00:01 jamesblackwell

Can you tell me some informations:

  • osx version
  • node version

Thank's

Le 26 janv. 2014 à 01:15, James Blackwell [email protected] a écrit :

Just got this exact error on Mac

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

Freyskeyd avatar Jan 26 '14 10:01 Freyskeyd

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

Sunny-fr avatar Jan 29 '14 20:01 Sunny-fr

Okey,

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

Can you post the full command output?

Thank's

Freyskeyd avatar Jan 29 '14 20:01 Freyskeyd

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)

Sunny-fr avatar Jan 29 '14 21:01 Sunny-fr

Mmmh ok i reproduce when composer is not install globaly

Freyskeyd avatar Jan 29 '14 21:01 Freyskeyd

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

Sunny-fr avatar Jan 29 '14 21:01 Sunny-fr

Ok, when you:

$ composer

What are you seeing?

Freyskeyd avatar Jan 29 '14 21:01 Freyskeyd

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

-bash: composer: command not found

Sunny-fr avatar Jan 29 '14 21:01 Sunny-fr

To install a correct composer you need to use:

curl -sS https://getcomposer.org/installer | php
$ mv composer.phar /usr/local/bin/composer

Freyskeyd avatar Jan 29 '14 21:01 Freyskeyd

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

Sunny-fr avatar Jan 29 '14 21:01 Sunny-fr

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

Freyskeyd avatar Jan 29 '14 21:01 Freyskeyd

You can contribute if you want !

Freyskeyd avatar Jan 29 '14 21:01 Freyskeyd

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

//bonne soirée !

Sunny-fr avatar Jan 29 '14 21:01 Sunny-fr

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

jamesblackwell avatar Jan 31 '14 12:01 jamesblackwell

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

vinizinmoraes avatar Aug 29 '14 18:08 vinizinmoraes

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

indvinoth avatar Oct 12 '14 20:10 indvinoth