bash: /usr/bin/express: /usr/bin/nodejs: bad interpreter: No such file or directory

Issue

i am trying to make template using this command –

express -e project-name

in node_modules – express and express-generator are both installed, i checked.

Also express --help does not work and writes same error.

Solution

Okay, i fixed this and if somebody ever will have this question here is answer:

  1. delete node and reinstall it with npm globally.

  2. run all of these 3 commands in terminal

    
    npm set prefix ~/.npm
    PATH="$HOME/.npm/bin:$PATH"
    PATH="./node_modules/.bin:$PATH"
    
  3. next install

    npm install -g express
    npm install -g express-generator
    

Answered By – Teodora-techie

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published