Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

building fails on windows 7 #370

Closed
brunoroussel opened this issue Jan 10, 2014 · 4 comments
Closed

building fails on windows 7 #370

brunoroussel opened this issue Jan 10, 2014 · 4 comments

Comments

@brunoroussel
Copy link

Hello,

I have a couple fixes and functionalities that I'd like to submit as pull resquests on swagger-ui but... first I need to compile swagger-ui from the source code. Until now, I've done all the work straight in javascript on the dist code... So, I back on the right track :)

but I cannot build swagger-ui on windows 7.

step 1: npm run-script build

[email protected] build c:\workspace\swagger-ui
PATH=$PATH:./node_modules/.bin cake dist
but cake does not started.. nothing happens.

step 2 : I tried to run cake on command line : cake dist

Build distribution in ./dist
path.existsSync is now called fs.existsSync.
: Reading src/main/coffeescript/SwaggerUi.coffee
: Reading src/main/coffeescript/view/HeaderView.coffee
: Reading src/main/coffeescript/view/MainView.coffee
: Reading src/main/coffeescript/view/ResourceView.coffee
: Reading src/main/coffeescript/view/OperationView.coffee
: Reading src/main/coffeescript/view/StatusCodeView.coffee
: Reading src/main/coffeescript/view/ParameterView.coffee
: Reading src/main/coffeescript/view/SignatureView.coffee
: Reading src/main/coffeescript/view/ContentTypeView.coffee
: Precompiling templates...
: Compiling src/main/template/content_type.handlebars
: Compiling src/main/template/main.handlebars
: Compiling src/main/template/operation.handlebars
: Compiling src/main/template/param.handlebars
: Compiling src/main/template/param_list.handlebars
: Compiling src/main/template/param_readonly.handlebars
: Compiling src/main/template/param_readonly_required.handlebars
: Compiling src/main/template/param_required.handlebars
: Compiling src/main/template/resource.handlebars
: Compiling src/main/template/signature.handlebars
: Compiling src/main/template/status_code.handlebars

c:\workspace\pfmediation\pfs\pfs-tools\swagger-ui\swagger-ui-master\swagger-ui\Cakefile:56
throw err;
^
Error: Command failed:
at ChildProcess.exithandler (child_process.js:637:15)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:735:16)
at Process.ChildProcess._handle.onexit (child_process.js:802:5)

handlebars templates are not generated. exec command does not work properly.

step3 : I found a previous issue that seems to be related :

#68

I tried to install handlebars and cake as global node modules
still the same errors...

step5 : I tried to generate the handlebars template on command line.

ok this works.

finally

so I don't understand why the exec command is not working, it seems that launching handlebars from cakefile does not work on windows 7...

I'm kind of stuck in the middle of the build and really have no idea...

Thanks for your help all.

Best Regards
Bruno

@AidasK
Copy link

AidasK commented Jan 14, 2014

Works for me(running from git bash):

npm install
npm install handlebars -g
npm install coffee-script -g
node_modules/.bin/cake dist
Build distribution in ./dist
path.existsSync is now called `fs.existsSync`.
   : Reading src/main/coffeescript/SwaggerUi.coffee
   : Reading src/main/coffeescript/view/HeaderView.coffee
   : Reading src/main/coffeescript/view/MainView.coffee
   : Reading src/main/coffeescript/view/ResourceView.coffee
   : Reading src/main/coffeescript/view/OperationView.coffee
   : Reading src/main/coffeescript/view/StatusCodeView.coffee
   : Reading src/main/coffeescript/view/ParameterView.coffee
   : Reading src/main/coffeescript/view/SignatureView.coffee
   : Reading src/main/coffeescript/view/ContentTypeView.coffee
   : Reading src/main/coffeescript/view/ResponseContentTypeView.coffee
   : Reading src/main/coffeescript/view/ParameterContentTypeView.coffee
   : Precompiling templates...
   : Compiling src/main/template/content_type.handlebars
   : Compiling src/main/template/main.handlebars
   : Compiling src/main/template/operation.handlebars
   : Compiling src/main/template/param.handlebars
   : Compiling src/main/template/parameter_content_type.handlebars
   : Compiling src/main/template/param_list.handlebars
   : Compiling src/main/template/param_readonly.handlebars
   : Compiling src/main/template/param_readonly_required.handlebars
   : Compiling src/main/template/param_required.handlebars
   : Compiling src/main/template/resource.handlebars
   : Compiling src/main/template/response_content_type.handlebars
   : Compiling src/main/template/signature.handlebars
   : Compiling src/main/template/status_code.handlebars
   : Collecting Coffeescript source...
   : Compiling...
   : Combining with javascript...
   : Minifying all...
   : Compiling LESS...
   : Packaging...
   : Copied swagger-ui libs
   : Copied swagger dependencies
   : Copied html dependencies
   !
null

@brunoroussel
Copy link
Author

Thanks AidasK for your response,
I tried to run it from git bash (msysgit) but I have the same issues :
I'm trying to figure out what happens and hopefully I'll come back to you with an explanation :).

$ ./node_modules/.bin/cake dist
Build distribution in ./dist
path.existsSync is now called fs.existsSync.
: Reading src/main/coffeescript/SwaggerUi.coffee
: Reading src/main/coffeescript/view/HeaderView.coffee
: Reading src/main/coffeescript/view/MainView.coffee
: Reading src/main/coffeescript/view/ResourceView.coffee
: Reading src/main/coffeescript/view/OperationView.coffee
: Reading src/main/coffeescript/view/StatusCodeView.coffee
: Reading src/main/coffeescript/view/ParameterView.coffee
: Reading src/main/coffeescript/view/SignatureView.coffee
: Reading src/main/coffeescript/view/ContentTypeView.coffee
: Precompiling templates...
: Compiling src/main/template/content_type.handlebars
: Compiling src/main/template/main.handlebars
: Compiling src/main/template/operation.handlebars
: Compiling src/main/template/param.handlebars
: Compiling src/main/template/param_list.handlebars
: Compiling src/main/template/param_readonly.handlebars
: Compiling src/main/template/param_readonly_required.handlebars
: Compiling src/main/template/param_required.handlebars
: Compiling src/main/template/resource.handlebars
: Compiling src/main/template/signature.handlebars
: Compiling src/main/template/status_code.handlebars

c:\swagger-ui\C
akefile:55
throw err;
^
Error: Command failed:
at ChildProcess.exithandler (child_process.js:637:15)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:735:16)
at Socket. (child_process.js:948:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:466:12)

@rage-shadowman
Copy link

FYI - It fails compiling for me too under Linux. I have to add [swagger_ui_dir]/node_modules/handlebars/bin to my PATH manually and it then compiles fine.

@fehguy
Copy link
Contributor

fehguy commented Mar 20, 2014

This sounds like a %PATH% issue. Please reopen if not.

@fehguy fehguy closed this as completed Mar 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants