我正在尝试使用以下命令运行我的应用程序:
@Autowired
private ApplicationContext applicationContext;
public void onEmailConfChange()
{
Properties properties = dao.getEmailConf();
EmailService emailService = (EmailService) applicationContext
.getBean("emailService");
emailService.setConfiguration(properties);
}
但我有这个错误:
forever start /var/www/app.js --prod
Sails已安装在同一目录中。 Forever全球安装。
我也测试
To run an app using `node app.js`, you usually need to have a version of `sails` installed in the same directory as your app.
To do that, run `npm install sails`
Alternatively, if you have sails installed globally (i.e. you did `npm install -g sails`), you can use `sails lift`.
When you run `sails lift`, your app will still use a local `./node_modules/sails` dependency if it exists,
but if it doesn't, the app will run with the global sails instead!
但同样的错误因此不是因为永远。
我在节点V4.1.1和npm v3.3.4下。 node app.js --prod
工作得很好。
答案 0 :(得分:3)
终于搞定了!
我没有正确安装某些sails依赖项,我已经删除了项目的所有node_modules文件夹,再次删除了npm install
,现在它正在运行。
错误消息不正确。
答案 1 :(得分:1)
您是否尝试过全局安装Sails?
答案 2 :(得分:1)
cd /var/www
forever start app.js --prod
请尝试这种方式并告诉它是否有效。
答案 3 :(得分:0)
尝试在应用程序中检查.sailsrc文件 我的错是逗号被遗漏了
"generators": {
"modules": {},
}
删除逗号对我有用