Json Node.JS可以';找不到节点调度模块

Json Node.JS可以';找不到节点调度模块,json,node.js,package,node-modules,nodejitsu,Json,Node.js,Package,Node Modules,Nodejitsu,好吧,我读过几十个类似的问题,但没有一个能解决我的问题——主要是因为我觉得我的问题有点深 我有几个模块在我的服务器(Nodejitsu)上运行良好,我认为我的安装方式与以前相同:npm安装express/connect/mongojs等 在my server.js中: var express = require('express'); var team = require('./team'); var users = require('./users'); var scheduler = req

好吧,我读过几十个类似的问题,但没有一个能解决我的问题——主要是因为我觉得我的问题有点深

我有几个模块在我的服务器(Nodejitsu)上运行良好,我认为我的安装方式与以前相同:npm安装express/connect/mongojs等

在my server.js中:

var express = require('express');
var team = require('./team');
var users = require('./users');
var scheduler = require('node-schedule');
现在,我正试图让节点计划模块正常工作,因此我通过npm安装了该模块,而在我的server.js文件的目录中,该模块确实进入了node_modules文件夹,但当我部署我的应用程序时,我得到了以下信息:

error:   module.js:340
error:       throw err;
error:             ^
error:   Error: Cannot find module 'node-schedule'
error:       at Function.Module._resolveFilename (module.js:338:15)
error:       at Function.Module._load (module.js:280:25)
error:       at Module.require (module.js:364:17)
error:       at require (module.js:380:17)
error:       at Object.<anonymous> (/opt/run/snapshot/package/server.js:5:1)
error:       at Module._compile (module.js:456:26)
error:       at Object.Module._extensions..js (module.js:474:10)
error:       at Module.load (module.js:356:32)
error:       at Function.Module._load (module.js:312:12)
error:       at Function.Module.runMain (module.js:497:10)
现在我在node_modules文件夹中有我提到的几个模块(express、mongojs…),它们在我部署时都可以正常工作,即使在我的package.json文件中没有提到它们-但是现在这个新模块,什么都没有。。。 我试过(基于过去的线程)用-g安装它,但仍然没有,我也试过链接它,没有

我发现有一个问题,因为当我尝试部署我的应用程序时,我在应用程序正在部署时看到:

connect@2.7.3 node_modules/connect
├── fresh@0.1.0
├── pause@0.0.1
├── cookie-signature@0.0.1
├── bytes@0.2.0
├── buffer-crc32@0.1.1
├── cookie@0.0.5
├── debug@0.7.2
├── send@0.1.0 (range-parser@0.0.4, mime@1.2.6)
├── formidable@1.0.11
└── qs@0.5.1

express@3.2.2 node_modules/express
├── methods@0.0.1
├── fresh@0.1.0
├── range-parser@0.0.4
├── cookie-signature@1.0.1
├── qs@0.6.3
├── buffer-crc32@0.2.1
├── cookie@0.0.5
├── debug@0.7.2
├── commander@0.6.1
├── mkdirp@0.3.4
├── send@0.1.0 (mime@1.2.6)
└── connect@2.7.8 (pause@0.0.1, bytes@0.2.0, formidable@1.0.13)

nodemailer@0.4.4 node_modules/nodemailer
├── simplesmtp@0.3.1 (xoauth2@0.1.8, rai@0.1.7)
└── mailcomposer@0.1.33 (mime@1.2.9, mimelib@0.2.12)

mongojs@0.7.5 node_modules/mongojs
├── thunky@0.1.0
├── readable-stream@1.0.2
└── mongodb@1.3.6 (kerberos@0.0.2, bson@0.1.8)
显然,节点调度并不存在。 我就是不明白 a) 当我的server.js package.json为空时,如何让原始模块工作。。。
b) 当它位于express connect和mongojs旁边时,怎么可能不需要找到它…

这在localhost中对我很有用:

执行后:npm安装节点计划--保存

在node_模块下有文件schedule.js


var scheduler=require('./node_modules/node schedule/lib/schedule.js')

由于权限/所有权,节点可能无法读取模块的目录。在您的开发环境中,通常会执行
npm安装[module]--save
,这会将依赖项添加到package.json中(或者您可以手动添加)。在此之后,
npm安装
应该安装您的所有依赖项。感谢您的回答-仍然找不到该模块。执行npm安装--save实际上并没有向我的package.json添加任何内容。我在package.json中手动添加了依赖项,但仍然没有任何内容
。。。。“main”:“server.js”,“dependencies”:{“mongojs”:“0.7.5”,“express”:“3.2.2”,“节点计划”:“0.1.13”}
还有其他建议吗?我在这里迷路了。。
connect@2.7.3 node_modules/connect
├── fresh@0.1.0
├── pause@0.0.1
├── cookie-signature@0.0.1
├── bytes@0.2.0
├── buffer-crc32@0.1.1
├── cookie@0.0.5
├── debug@0.7.2
├── send@0.1.0 (range-parser@0.0.4, mime@1.2.6)
├── formidable@1.0.11
└── qs@0.5.1

express@3.2.2 node_modules/express
├── methods@0.0.1
├── fresh@0.1.0
├── range-parser@0.0.4
├── cookie-signature@1.0.1
├── qs@0.6.3
├── buffer-crc32@0.2.1
├── cookie@0.0.5
├── debug@0.7.2
├── commander@0.6.1
├── mkdirp@0.3.4
├── send@0.1.0 (mime@1.2.6)
└── connect@2.7.8 (pause@0.0.1, bytes@0.2.0, formidable@1.0.13)

nodemailer@0.4.4 node_modules/nodemailer
├── simplesmtp@0.3.1 (xoauth2@0.1.8, rai@0.1.7)
└── mailcomposer@0.1.33 (mime@1.2.9, mimelib@0.2.12)

mongojs@0.7.5 node_modules/mongojs
├── thunky@0.1.0
├── readable-stream@1.0.2
└── mongodb@1.3.6 (kerberos@0.0.2, bson@0.1.8)