2016-11-06 119 views
1

当试图运行一个nodejs服务器时,我不断收到一个缺少模块'./algs'的错误信息。有谁知道我需要安装哪个模块才能使其工作?错误:找不到模块'./algs'

错误:

$ node index 
module.js:457 
throw err; 
^ 

Error: Cannot find module './algs' 
    at Function.Module._resolveFilename (module.js:455:15) 
    at Function.Module._load (module.js:403:25) 
    at Module.require (module.js:483:17) 
    at require (internal/module.js:20:19) 
    at Object.<anonymous> (C:<file path>\node_modules\sshpk\lib\key.js:6:12) 
    at Module._compile (module.js:556:32) 
    at Object.Module._extensions..js (module.js:565:10) 
    at Module.load (module.js:473:32) 
    at tryModuleLoad (module.js:432:12) 
    at Function.Module._load (module.js:424:3) 

的package.json:

{ 
    "name": "Stock", 
    "version": "0.2.5", 
    "description": "Stock website", 
    "engines": { 
    "node": "5.9.1" 
    }, 
    "main": "index.js", 
    "scripts": { 
    "start": "node index.js" 
    }, 
    "dependencies": { 
    "body-parser": "^1.15.2", 
    "ejs": "2.4.1", 
    "express": "4.13.3", 
    "firebase": "^3.5.2", 
    "jquery": "^3.1.1", 
    "multer": "^1.2.0", 
    "watson-developer-cloud": "^2.8.1" 
    }, 
    "repository": { 
    "type": "git", 
    "url": "<git url>" 
    }, 
    "keywords": [ 
    "node", 
    "heroku", 
    "express" 
    ], 
    "license": "MIT" 
} 

我试图​​和./algs,但它不工作。

回答

1

我不确定,但我不认为这是关于algs模块或者是否有任何模块algs

今天发生了类似的事情。我正在使用event-streamgulp并尝试连接两个流。在运行代码的同时,我看到一些像你的随机模块error,有趣的是我甚至没有在我的代码中使用随机模块。然后我仔细观察,发现我在两个流之间缺少一个逗号。我猜想显示error缺失的模块是event-stream(我用过的模块)的依赖项。

我不是说你像我这样的佣人错误,但仔细看看可能会帮助你。