dawson-org / dawson-cli

A serverless web framework for Node.js on AWS (CloudFormation, CloudFront, API Gateway, Lambda)
https://dawson.sh
GNU General Public License v3.0
713 stars 25 forks source link

Local install using NPM not working #209

Closed ojizero closed 6 years ago

ojizero commented 6 years ago

When installing Dawson locally using NPM, it can't run deployment of the code, exits with the following error.

dawson internal error: spawn /Users/oji/Workspace/Work/lambdas/mono/dawson-framework/node_modules/dawson/node_modules/.bin/babel ENOENT
Error: spawn /Users/oji/Workspace/Work/lambdas/mono/dawson-framework/node_modules/dawson/node_modules/.bin/babel ENOENT
    at _errnoException (util.js:1022:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
    at onErrorNT (internal/child_process.js:372:16)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickDomainCallback (internal/process/next_tick.js:218:9)

After tracing the error in the code, I suspect the error is caused by the code returning the child process of Babel in the first trial using the babelPath that works with the Global or Yarn installed module, specifically this line.

Since execa returns a promise, and nothing waits on it, causing the code to return before the catch block is catches the ENOENT error.


Node version: v8.9.4 NPM version: 5.6.0 OS: macOS 10.13.2

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

aguyinmontreal commented 6 years ago

found a fix?

ojizero commented 6 years ago

@aguyinmontreal so sorry for the late response, I suspect the fix for this would be to await when running execa in this line, but I'm not 100% sure nor did I test it honestly as I was only testing Dawson, and ended up using Apex since it fit our needs better.

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.