node.js - 使用 Flightplan 和 Bower 进行部署

标签 node.js express digital-ocean

我正在尝试使用 Flightplan 将一个小型 Nodejs 项目部署到 Digitalocean。或多或少一切正常。但是,我有 3 个关于 Bower 的问题:

1)当我使用“fly”命令部署时,bower.json 似乎被忽略并且没有推送到服务器。

2) 在我的 VPS 上运行 bower install 时,它不会创建 src 文件夹,而是将 Bower_modules 放入应用程序的根文件夹中。这会阻止我的 express.static 命令。

3) 我应该如何更改 Flightplan.js 文件以自动安装 Bower? 我尝试了这个,但它抛出一个错误

  remote.sudo('npm --production --prefix ~/' + tmpDir + ' install ~/' + tmpDir, {user: username});
  remote.sudo('bower ~/' + tmpDir + ' install ~/' + tmpDir, {user: username});

这是我的 .gitignore 文件(据我所知,flightplan 在部署时会尊重它?)

node_modules/
src/bower_modules

最佳答案

我正在使用这个:

remote.exec('cd /home/deploy/'+tmpDir+'; ' +'ls'+';'+'bower install');

这对我有用。

关于node.js - 使用 Flightplan 和 Bower 进行部署,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29741430/

相关文章:

java - 如何为 Web 应用程序设置 tomcat 上下文路径? .war 文件名位于 url 中应用程序名称的前面

ruby-on-rails - 更改 git 的 Remote 在 digital ocean 上不起作用

mysql - Sequelize 错误 : you must use the 'as' keyword to specify the alias of the association you want to include. - node.js

javascript - 使用 Express 从 Javascript 向 Node.js 发送/接收数据

javascript - 使用 react 和 node 不使用 req.files 上传图像

python - `pip install pandas` 给出 UnicodeDecodeError : 'ascii' codec can't decode byte 0xe2 in position 41: ordinal not in range(128)

node.js - 使用 AWS 在 Dynamodb 中搜索

mysql - 如何对意外删除的表运行特定迁移

Node.js:链式 process.exit() 调用

javascript - Expressjs 检查重新加载页面上的 header