title: Error while deploying NextJS app to AWS with serverless framework
body: <p>When I tried to deploy my NextJS app to AWS with serverless framework.</p>
  <p>In my next JS app directory, I ran the command <code>npx serverless</code></p>
  <p>and got the following error -</p>
  <pre><code>$ npx serverless
  
    error:
    Error: Command failed with ENOENT: node_modules/.bin/next build
  spawn node_modules/.bin/next ENOENT
  'node_modules\.bin\next' is not recognized as an internal or external command,
  operable program or batch file.
      at notFoundError (C:\Users\patel\.serverless\components\registry\npm\@sls-next\serverless-component@1.18.0\node_modules\@sls-next\serverless-component\node_modules\cross-spawn\lib\enoent.js:6:26)
      at verifyENOENT (C:\Users\patel\.serverless\components\registry\npm\@sls-next\serverless-component@1.18.0\node_modules\@sls-next\serverless-component\node_modules\cross-spawn\lib\enoent.js:40:16)
      at ChildProcess.cp.emit (C:\Users\patel\.serverless\components\registry\npm\@sls-next\serverless-component@1.18.0\node_modules\@sls-next\serverless-component\node_modules\cross-spawn\lib\enoent.js:27:25)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12) {
    code: 'ENOENT',
    errno: 'ENOENT',
    syscall: 'spawn node_modules/.bin/next',
    path: 'node_modules/.bin/next',
    spawnargs: [ 'build' ],
    originalMessage: 'spawn node_modules/.bin/next ENOENT',
    shortMessage: 'Command failed with ENOENT: node_modules/.bin/next build\n' +
      'spawn node_modules/.bin/next ENOENT',
    command: 'node_modules/.bin/next build',
    exitCode: undefined,
    signal: undefined,
    signalDescription: undefined,
    stdout: '',
    stderr: &quot;'node_modules\\.bin\\next' is not recognized as an internal or external command,\r\n&quot; +
      'operable program or batch file.',
    failed: true,
    timedOut: false,
    isCanceled: false,
    killed: false
  }
  
    3s » myNextApplication » Error: Command failed with ENOENT: node_modules/.bin/next build
  spawn node_modules/.bin/next ENOENT
  'node_modules\.bin\next' is not recognized as an internal or external command,
  operable program or batch file.
  </code></pre>
  <p>I'm using <code>aws configure</code> to set my AWS credentials.</p>
  <p>My <code>serverless.yml</code> file is as follow,</p>
  <pre><code>myNextApplication:
    component: &quot;@sls-next/serverless-component@1.18.0&quot;
  </code></pre>
  <p>How should I deploy my app to AWS cloud with a serverless framework?</p>
  <p>Thanks.</p>