biggora / caminte

Cross-db ORM for NodeJS
http://www.camintejs.com/
MIT License
1.08k stars 119 forks source link

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function #204

Open MrManny opened 5 years ago

MrManny commented 5 years ago

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, caminte-cli@1.3.1 was installed globally and I have my package.json with the dependency caminte@0.4.1 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: Node@10.8.0, npm@6.4.1, Windows 7.

sharmasagar25 commented 5 years ago

having the same issue. please help resolve.

Environment: MacOS Mojave, Node@10.13.0, npm@6.4.1

rblasquez commented 5 years ago

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

evan-boissonnot commented 5 years ago

got the same too :(

Environment : Widows 10, VS Code, Node@10.5.0, npm@6.4.1

simonefuoco commented 5 years ago

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.