hwz / chirp

A teaching example of the MEAN stack, by building a simple Twitter clone
317 stars 484 forks source link

Cannot find module 'morgan' at Function.Module._resolveFilename (module.js:469:15) #41

Open rochakravi opened 7 years ago

rochakravi commented 7 years ago

I used git clone and then completed=> node app.js then found above error . I dnt have how to resolve this so that i can see working code . Can anyone please help me?.

sagarsrao commented 7 years ago

Hey,

Run this command from the node package file.

npm install morgan

To add this npm package to your local machine, type the above into your command line. You’ll notice a node_modules directory appear in your root where the package is now installed.

If you're having trouble installing packages, check out the helpful docs for installing npm packages locally

Your purpose will be served.

Thanks, Anonymous

On Jul 9, 2017 12:24 AM, "rochakravi" notifications@github.com wrote:

I used git clone and then completed=> node app.js then found above error . I dnt have how to resolve this so that i can see working code . Can anyone please help me?.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hwz/chirp/issues/41, or mute the thread https://github.com/notifications/unsubscribe-auth/ATWtjg6KLPlB_LDYVy0xv5GPcGXygHcpks5sL9B8gaJpZM4OR1fy .

rochakravi commented 7 years ago

Now got below error

Error: failed to connect to [localhost:27017] at . (C:\Users\admin\Desktop\dabba\hwz\chirp\module-5\completed\node_modules\mongodb\lib\mongodb\connection\server.js:549:25) at emitThree (events.js:116:13) at emit (events.js:194:7) at . (C:\Users\admin\Desktop\dabba\hwz\chirp\module-5\completed\node_modules\mongodb\lib\mongodb\connection\connection_pool.js:150:15) at emitTwo (events.js:106:13) at emit (events.js:191:7) at Socket. (C:\Users\admin\Desktop\dabba\hwz\chirp\module-5\completed\node_modules\mongodb\lib\mongodb\connection\connection.js:533:10) at emitOne (events.js:96:13) at Socket.emit (events.js:188:7) at emitErrorNT (net.js:1281:8)

On Sun, Jul 9, 2017 at 1:41 AM, SAGARSRAO notifications@github.com wrote:

Hey,

Run this command from the node package file.

npm install morgan

To add this npm package to your local machine, type the above into your command line. You’ll notice a node_modules directory appear in your root where the package is now installed.

If you're having trouble installing packages, check out the helpful docs for installing npm packages locally

Your purpose will be served.

Thanks, Anonymous

On Jul 9, 2017 12:24 AM, "rochakravi" notifications@github.com wrote:

I used git clone and then completed=> node app.js then found above error . I dnt have how to resolve this so that i can see working code . Can anyone please help me?.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hwz/chirp/issues/41, or mute the thread https://github.com/notifications/unsubscribe-auth/ATWtjg6KLPlB_ LDYVy0xv5GPcGXygHcpks5sL9B8gaJpZM4OR1fy .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/hwz/chirp/issues/41#issuecomment-313878414, or mute the thread https://github.com/notifications/unsubscribe-auth/ATAiLH-qoe6FOU8luigGS3ZZ1IV3mAdtks5sL-KAgaJpZM4OR1fy .

-- ravi raj

Iman-ik1510048 commented 6 years ago

try changing the port number

rodcunha commented 6 years ago

internal/modules/cjs/loader.js:596 throw err; ^

Error: Cannot find module 'morgan' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:594:15) at Function.Module._load (internal/modules/cjs/loader.js:520:25) at Module.require (internal/modules/cjs/loader.js:650:17) at require (internal/modules/cjs/helpers.js:20:18)

I've tried installing with --save-dev and even globally but doesn't seem to work, always get this error at require.

neydoo commented 6 years ago

try npm link morgan

lakshmankotiki commented 5 years ago

@rodcunha Seems like mongoose-morgon also do the same thing. npm install mongoose-morgan Worked for me, and its showing loggers in console too

Wachiye commented 4 years ago

I ran npm I morganand npm I Morgan --local but it never solved. I just tried npm link morgan and I was saved.