caminte icon indicating copy to clipboard operation
caminte copied to clipboard

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function

Open MrManny opened this issue 6 years ago • 4 comments

I have just tried setting up a completely fresh project from scratch to try out caminte like so (in a newly created, empty directory):

npm i -g caminte-cli
npm init -y
npm i --save caminte

At this point, [email protected] was installed globally and I have my package.json with the dependency [email protected] in it. So far, so great.

Next, I have issued this command:

caminte -i -a sqlite3

destination is not empty, continue? [y/N] y
   create : ./models
   create : ./test
   create : ./routes
   Add the following strings
   to your express app.js:

   var models = require('./models');
   models.init(app);


fs.js:127
  throw new ERR_INVALID_CALLBACK();
  ^

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
    at maybeCallback (fs.js:127:9)
    at Object.writeFile (fs.js:1123:14)
    at write (C:\Users\[omitted]\AppData\Roaming\npm\node_modules\caminte-cli\bin\caminte:743:8)
    at C:\Users\[omitted]\AppData\Roaming\npm\node_modules\caminte-cli\bin\caminte:647:13
    at C:\Users\[omitted]\AppData\Roaming\npm\node_modules\caminte-cli\node_modules\async\dist\async.js:3888:9
    at C:\Users\[omitted]\AppData\Roaming\npm\node_modules\caminte-cli\node_modules\async\dist\async.js:473:16
    at iteratorCallback (C:\Users\[omitted]\AppData\Roaming\npm\node_modules\caminte-cli\node_modules\async\dist\async.js:1064:13)
    at C:\Users\[omitted]\AppData\Roaming\npm\node_modules\caminte-cli\node_modules\async\dist\async.js:969:16
    at C:\Users\[omitted]\AppData\Roaming\npm\node_modules\caminte-cli\node_modules\async\dist\async.js:3885:13
    at C:\Users\[omitted]\AppData\Roaming\npm\node_modules\caminte-cli\bin\caminte:761:30

Same with the mysql adapter.

The environment is: [email protected], [email protected], Windows 7.

MrManny avatar Nov 15 '18 13:11 MrManny

having the same issue. please help resolve.

Environment: MacOS Mojave, [email protected], [email protected]

sharmasagar25 avatar Nov 28 '18 03:11 sharmasagar25

It happens to me the same, I can not find the solution.

rblasquez avatar Dec 06 '18 13:12 rblasquez

got the same too :(

Environment : Widows 10, VS Code, [email protected], [email protected]

evan-boissonnot avatar Dec 10 '18 23:12 evan-boissonnot

Hi everyone, I resolved this issue because I got the same error with Node.js version >= 10.x.x This is specifically a problem of caminte-cli. I reference my pull request with the fix.

simonefuoco avatar Dec 11 '18 10:12 simonefuoco