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

cake dist is failing on windows 7 - Error: Command failed: 'node_modules' is not recognized as an internal or external command, operable program or batch file. #68

Closed
arjunballa opened this issue Oct 5, 2012 · 7 comments

Comments

@arjunballa
Copy link
Contributor

Using
nodejs - v0.8.11
coffee-script - latest
cake - latest

C:\Arjun\projects\swagger-ui>cake dist
path.existsSync is now called fs.existsSync.
Build distribution in ./dist
: 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/ParameterView.coffee
: Precompiling templates...
: 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

C:\Arjun\servicemesh\projects\swagger-ui\Cakefile:59
throw err;
^
Error: Command failed: 'node_modules' is not recognized as an internal or external command,
operable program or batch file.

at ChildProcess.exithandler (child_process.js:540:15)
at ChildProcess.EventEmitter.emit (events.js:96:17)
at maybeClose (child_process.js:638:16)
at Socket.ChildProcess.spawn.stdin (child_process.js:815:11)
at Socket.EventEmitter.emit (events.js:93:17)
at Socket._destroy.destroyed (net.js:357:10)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
@ayush
Copy link
Contributor

ayush commented Oct 6, 2012

I haven't tries this on windows and node_modules folder is actually committed into the project for handlebars compilation. I wonder if this is something silly like using the windows path separator over here: https://github.com/wordnik/swagger-ui/blob/master/Cakefile#L6 Could you please check?

@arjunballa
Copy link
Contributor Author

The problem is with exec command https://github.com/wordnik/swagger-ui/blob/master/Cakefile#L41.
For some reason exec command is parsing and taking the first part.
I tried and got following errors

  1. ./node_modules/handlebars/bin/handlebars - . is not recognized as an internal or external command
  2. node_modules//handlebars//bin//handlebars and - node_modules is not recognized as an internal or external command
  3. node_modules\handlebars\bin\handlebars - 'node_modules\handlebars\bin\handlebars is not recognized as an internal or external command
  4. C:\Arjun\projects\swagger-ui\node_modules\handlebars\bin\handlebars - 'C:\Arjun\projects\swagger-ui\node_modules\handlebars\bin\handlebars' is not recognized as an internal or external command
  5. .\node_modules\handlebars\bin\handlebars - .\node_modules\handlebars\bin\handlebars is not recognized as an internal or external command

I also tried the same on cygwin and got same errors.

Everything works fine on my MAC but doesnt work on windows
Can you please help me in fixing this.

@arjunballa
Copy link
Contributor Author

Ayush - can you help me in fixing this

@ayush
Copy link
Contributor

ayush commented Oct 9, 2012

Hey, I'll look at this summer more today and let you know.

@ayush ayush closed this as completed in c4dfb91 Oct 9, 2012
@ayush
Copy link
Contributor

ayush commented Oct 9, 2012

Ok, here is the deal:

  • pull the latest master
  • install handlebars using 'npm install handlebars -g' (I've updated the README)
  • cake dist

@arjunballa
Copy link
Contributor Author

Thanks for the fix. It fixed the path problem in cake file but introduced one more issue but this time I have a solution :-)

The swagger-ui handlebar templates are only compatible with 1.0.5beta npm package version. There is no 1.0.beta.6 npm package available(the one swagger-ui included in npm_module).

Details
npm Valid install targets:
npm ["1.0.2beta","1.0.4beta","1.0.5beta","1.0.6","1.0.6-2","1.0.7"]

npm install handlebars -g - will install the latest version and swagger-ui handlebar template are not compatible.

Hence we need to install 1.0.5beta version - npm install [email protected] -g.
#69

@arjunballa
Copy link
Contributor Author

Can we delete https://github.com/wordnik/swagger-ui/tree/master/node_modules/handlebars as we are using globally installed npm package?

ayush added a commit that referenced this issue Nov 20, 2012
Fixes Issue  #68 in a generic way for any param with any regex
vincent-zurczak pushed a commit to roboconf/swagger-ui that referenced this issue Aug 18, 2016
vincent-zurczak pushed a commit to roboconf/swagger-ui that referenced this issue Aug 18, 2016
vincent-zurczak pushed a commit to roboconf/swagger-ui that referenced this issue Aug 18, 2016
Fixes Issue  swagger-api#68 in a generic way for any param with any regex
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

2 participants