Unable to use express with node v9.x

I have an Ubuntu box with node v 9.5.0 Npm 5.6.0
I get the following error for any express command

$ express -h 
module.js:557
    throw err;
    ^

Error: Cannot find module 'commander'
    at Function.Module._resolveFilename (module.js:555:15)
    at Function.Module._load (module.js:482:25)
    at Module.require (module.js:604:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/lib/nodejs/express-generator/bin/express:3:15)
    at Module._compile (module.js:660:30)
    at Object.Module._extensions..js (module.js:671:10)
    at Module.load (module.js:573:32)
    at tryModuleLoad (module.js:513:12)
    at Function.Module._load (module.js:505:3)

Author: Fantashit

1 thought on “Unable to use express with node v9.x

  1. It looks like your global install of express-generator is corrupted where npm didn’t install some of the dependencies. Can you try a reinstall and see if that helps?

    npm i -g express-generator
    

Comments are closed.