node.js - 错误: Cannot find module './algs'

标签 node.js module npm npm-install

当尝试运行 Node.js 服务器时,我不断收到此错误,因为缺少模块“./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"
}

我尝试过 npm install algs./algs 但它不起作用。

最佳答案

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

今天我也遇到了类似的事情。我将 event-streamgulp 一起使用,并尝试连接两个流。在运行代码时,我看到了一些像您一样的随机模块错误,有趣的是我什至没有在代码中使用该随机模块。然后我仔细观察,发现两个流之间缺少一个逗号。我猜想由错误显示丢失的模块是event-stream(我使用过的模块)的依赖项。

我并不是说你像我一样犯了错误,但仔细看看可能会对你有所帮助。

关于node.js - 错误: Cannot find module './algs' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40450826/

相关文章:

Haskell - 找不到模块 'Test.QuickCheck'

Angular2,预编译功能模块时出现元数据错误

npm - 这个错误是什么意思?有 `useBuiltIns` 选项,需要直接设置 `corejs` 选项

javascript - 设置内容类型后发送后无法设置 header

node.js - axios 在发送数据时给我将循环结构转换为 json 错误

node.js - app.use(multer({dest :'./uploads/' }).single ('photo' )) 返回 "Undefined is not a function"

node.js - 如何更新passportjs设置的req.user session 对象?

python - 没有名为 bidi.algorithm 的模块

node.js - browserify 已安装,但在命令行中不可用

node.js - npm下载phonegap多次报错