shime / codewars Goto Github PK
View Code? Open in Web Editor NEWA missing command line client for Codewars API
Home Page: http://codewars.com/
A missing command line client for Codewars API
Home Page: http://codewars.com/
I am on a macbook running Mojave 10.14.4.
I have run npm install -g codewars-client
. However, when I then run:
codewars setup --token <my token went here>
I get:
fs.js:134
throw new ERR_INVALID_CALLBACK();
^
TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
at maybeCallback (fs.js:134:9)
at Object.writeFile (fs.js:1180:14)
at /usr/local/lib/node_modules/codewars-client/index.js:76:8
at /usr/local/lib/node_modules/codewars-client/node_modules/mkdirp/index.js:48:26
at FSReqCallback.oncomplete (fs.js:160:5)
I have wrapped my token as a string "12345"
and also as blank text 12345
.
Apologies as I am new to raising issues on GitHub and this issue relates to a previous issue that has already been closed - I don't know whether to re-open an old issue or make a new issue as I don't know the protocol.
Thanks! Love the idea of this cli - it means I will get to upskill in my coding and zsh/neovim usage all at once!
I cannot setup codewars
. codewars setup --token "MYTOKEN"
always returns the error pictured below. I have tried MYTOKEN
both with and without the quotation marks. Additionally, I have tried this on node 0.8.28, 0.10.40, 0.11.16, 0.12.7, 4.0.0, and 4.1.0.
If I can help to debug the error, please let me know how.
codewars submit
should only work for verified and correct solutions and it should throw errors otherwise.
When I train this kata (an example, they all have the same problem).
{
"_data": {
"success": true,
"name": "Square(n) Sum",
"slug": "square-n-sum",
"description": "Complete the `squareSum`/`square_sum`/`SquareSum` method so that it squares each number passed into it and then sums the results together.\n\nFor example:\n```javascript\nsquareSum([1, 2, 2]); // should return 9\n```\n```coffeescript\nsquareSum([1, 2, 2]) # should return 9\n```\n```python\nsquare_sum([1, 2, 2]) # should return 9\n```\n```ruby\nsquareSum([1, 2, 2]) # should return 9\n```\n```crystal\nsquareSum([1, 2, 2]) # should return 9\n```\n```haskell\nsquareSum [1, 2, 2] -- should return 9\n```\n```dart\nsquareSum([1, 2, 2]); // should return 9\n```\n```rust\nsquare_sum([1, 2, 2]) // should return 9\n```\n```cpp\nsquare_sum({1, 2, 2}); // should return 9\n```\n```csharp\nKata.SquareSum(new int[] {1, 2, 2}) # should return 9\n```\n```c\nconst int values[] = { 1, 2, 2 };\nconst size_t count = sizeof(values)/sizeof(values[0]);\n\nsquare_sum(values, count); // should return 9\n```\n",
"author": null,
"rank": -8,
"averageCompletion": 39604.54756929734,
"tags": [
"Fundamentals",
"Arithmetic",
"Mathematics",
"Algorithms",
"Logic",
"Numbers",
"Arrays",
"Data Types",
"Lists",
"Data Structures"
],
"session": {
"projectId": "5b6d9b0d68cb2eef1b0000e4",
"solutionId": "5b6d9b0eb3d9774eaf000002",
"setup": "function squareSum(numbers){\n\n}",
"exampleFixture": "Test.assertEquals(squareSum([1,2]), 5)\nTest.assertEquals(squareSum([0, 3, 4, 5]), 50)",
"code": null,
"recentlyAttempted": null
}
},
"name": "Square(n) Sum",
"description": "Complete the `squareSum`/`square_sum`/`SquareSum` method so that it squares each number passed into it and then sums the results together.\n\nFor example:\n```javascript\nsquareSum([1, 2, 2]); // should return 9\n```\n```coffeescript\nsquareSum([1, 2, 2]) # should return 9\n```\n```python\nsquare_sum([1, 2, 2]) # should return 9\n```\n```ruby\nsquareSum([1, 2, 2]) # should return 9\n```\n```crystal\nsquareSum([1, 2, 2]) # should return 9\n```\n```haskell\nsquareSum [1, 2, 2] -- should return 9\n```\n```dart\nsquareSum([1, 2, 2]); // should return 9\n```\n```rust\nsquare_sum([1, 2, 2]) // should return 9\n```\n```cpp\nsquare_sum({1, 2, 2}); // should return 9\n```\n```csharp\nKata.SquareSum(new int[] {1, 2, 2}) # should return 9\n```\n```c\nconst int values[] = { 1, 2, 2 };\nconst size_t count = sizeof(values)/sizeof(values[0]);\n\nsquare_sum(values, count); // should return 9\n```\n",
"slug": "square-n-sum",
"setup": "function squareSum(numbers){\n\n}",
"tests": "Test.assertEquals(squareSum([1,2]), 5)\nTest.assertEquals(squareSum([0, 3, 4, 5]), 50)",
"solutionId": "5b6d9b0eb3d9774eaf000002",
"projectId": "5b6d9b0d68cb2eef1b0000e4",
"rank": "8"
}
And provide this solution in an index.js file.
function squareSum(numbers){
return numbers.reduce(function(sum, number){
return sum + (number*number)
}, 0);
}
and verify as
$ codewars verify index.js
I get the following result:
Nope. Your solution is incorrect. :(
## Stack trace
undefined
## Tests
Sometimes this error appears:
(node:90314) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added. Use emitter.setMaxListeners() to increase limit
The solution is verified and passes if I paste it into the Codewars.com browser editor.
npm package has error with fs.writeFile() without callbacks.
if I want to train this kata: http://www.codewars.com/kata/539a0e4d85e3425cb0000a88
I would like to be able to start the training with
codewars train 539a0e4d85e3425cb0000a88
codewars -h
prints the help message twice. It probably makes sense to print it once.
Not important, but it was easy enough to fix (see #6).
When I check out the documentation in the CLI it says that only JavaScript and Ruby are supported. Are there any plans to add other languages (Python) to the supported languages?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.