caminte
caminte copied to clipboard
TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
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.
having the same issue. please help resolve.
Environment: MacOS Mojave, [email protected], [email protected]
It happens to me the same, I can not find the solution.
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.