【发布时间】:2015-12-30 10:19:54
【问题描述】:
我正在尝试使用以下命令运行我的应用程序:
forever start /var/www/app.js --prod
但我有这个错误:
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!
Sails 已安装在同一目录中。 Forever 是全局安装的。
我也测试了
node app.js --prod
但同样的错误,所以它不是因为永远。
我在节点 V4.1.1 和 npm v3.3.4 下。 sails lift 工作得很好。
【问题讨论】:
-
您是否尝试按照错误消息的提示执行操作?
-
是的 :) 也尝试删除 node-modules/sails 并再次 npm install 但没有运气...
-
你试过运行$ npm install,然后运行,$ forever start app.js吗?