lukeslytalker
lukeslytalker

Reputation: 111

Error: Cannot find module 'ms'

I've been trying to get my app running for a few days now, but keep getting errors. I'm closer than I have been so far, but am now getting the "Cannot find module error" when trying to launch my application.

Below is the error I'm getting now.

C:\MY-APP\dataService>node dataAPI.js
module.js:338
    throw err;
          ^
Error: Cannot find module 'ms'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (C:\MY-APP\node_modules\express\node_modules\debug
\debug.js:14:20)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)

I also searched the forums for an answer to this question and found this post on Stack Overflow, but it was in reference to Azure, which I'm not using.

I'm new to Node.js so forgive me if I sound like I don't know what I'm talking about because that's largely the truth.

Upvotes: 7

Views: 14384

Answers (2)

Josh Yolles
Josh Yolles

Reputation: 108

Just in case the above answer doesn't work for someone with this problem: I had this same problem when trying to run tests using the Puppeteer framework. I ended up having to cd into the node_modules/puppeteer folder and manually running npm install for it to finally work in my case.

Upvotes: 0

Nitesh singh
Nitesh singh

Reputation: 941

please see this Link : https://www.npmjs.com/package/ms

and use :

npm install ms -S

on your project its automatically save ms package to the node-module.

Upvotes: 8

Related Questions