Reputation: 55
I installed the express module using npm and -g option. The command shows up in the bash browser but in the node terminal, it shows this error.
require.resolve('express')
Error: Cannot find module 'express'
at Function.Module._resolveFilename (module.js:339:15)
at Function.require.resolve (internal/module.js:23:19)
at repl:1:9
at REPLServer.defaultEval (repl.js:252:27)
at bound (domain.js:287:14)
at REPLServer.runBound [as eval] (domain.js:300:12)
at REPLServer.<anonymous> (repl.js:417:12)
at emitOne (events.js:95:20)
at REPLServer.emit (events.js:182:7)
at REPLServer.Interface._onLine (readline.js:211:10)
What am I doing wrong? I also installed express-generator but still wouldn't do
My .bashrc
file has these entries:
export PATH="$HOME/.linuxbrew/bin:$PATH"
export MANPATH="$HOME/.linuxbrew/share/man:$MANPATH"
export INFOPATH="$HOME/.linuxbrew/share/info:$INFOPATH"
Upvotes: 0
Views: 195
Reputation: 662
Run this command in the directory where you have placed package.json
npm install express --save
Upvotes: 2