Launch node.js app from subdirectory (monorepo)

0

I have a monorepo with various shared assets folders and a node.js "webapp" folder.

How can I use the "/webapp" directory and its package.json to launch?

I added a Procfile to the root directory with the following:

web: cd webapp && npm start

This now errors with:

----------------------------------------
/var/log/web.stdout.log
----------------------------------------
Aug 27 00:26:39 ip-10-185-211-24 web: > Elastic-Beanstalk-Sample-App@0.0.1 start /var/app/current
Aug 27 00:26:39 ip-10-185-211-24 web: > node app.js
Aug 27 00:26:39 ip-10-185-211-24 web: Server running at http://127.0.0.1:8080/
Aug 27 00:36:51 ip-10-185-211-24 web: npm ERR! missing script: start
Aug 27 00:36:51 ip-10-185-211-24 web: npm ERR! A complete log of this run can be found in:
Aug 27 00:36:51 ip-10-185-211-24 web: npm ERR!     /home/webapp/.npm/_logs/2020-08-27T00_36_51_197Z-debug.log

The package.json has a start key so I assume its not using the correct package.json.

wonka
feita há 4 anos577 visualizações
1 Resposta
0

The solution was to add a Procfile to the root directory with the following:

web: cd webapp && npm start
wonka
respondido há 4 anos

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas