2

On my ubuntu terminal, when I run:

express --view=no-view notevi_api

The files are note generated correctly, I don't get my app.js and this shows up:

create : notevi_api

install dependencies:
  $ cd notevi_api && npm install

run the app:
  $ DEBUG=my-application ./bin/www

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

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
    at maybeCallback (fs.js:128:9)
    at Object.writeFile (fs.js:1163:14)
    at write (/usr/lib/nodejs/express-generator/bin/express:232:6)
    at /usr/lib/nodejs/express-generator/bin/express:197:5
    at /usr/lib/nodejs/express-generator/bin/express:247:11
    at /usr/share/nodejs/mkdirp/index.js:30:20
    at FSReqWrap.args [as oncomplete] (fs.js:140:20)

How can I solve this ERR_INVALID_CALLBACK?

1 Answers1

0

I found the answer. I had to install express as a root. sudo npm install -g express-generator

I found this on another stackoverflow post: express --view=hbs myapp getting [ERR_INVALID_CALLBACK]: Callback must be a function