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
질문됨 4년 전577회 조회
1개 답변
0

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

web: cd webapp && npm start
wonka
답변함 4년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠