Serverless-next.js: Error command execution npx serverless

Created on 18 Oct 2019  Â·  3Comments  Â·  Source: serverless-nextjs/serverless-next.js

  • Node Version: 10.16.3
  • Framework Version: 1.54.0
  • Plugin Version: 3.1.2
  • SDK Version: 2.1.2
  • Components Core Version: 1.1.1
  • Components CLI Version: 1.4.0

    serverless.yml
    myApp:
    component: serverless-next.js

`{ Error: Command failed with exit code 2 (ENOENT): node_modules/.bin/next build
spawn node_modules/.bin/next ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
errno: 'ENOENT',
syscall: 'spawn node_modules/.bin/next',
path: 'node_modules/.bin/next',
spawnargs: [ 'build' ],
originalMessage: 'spawn node_modules/.bin/next ENOENT',
command: 'node_modules/.bin/next build',
exitCode: 2,
exitCodeName: 'ENOENT',
stdout: '',
stderr: '',
all: '',
failed: true,
timedOut: false,
isCanceled: false,
killed: false,
signal: undefined }

1s › myApp › Error: Command failed with exit code 2 (ENOENT): node_modules/.bin/next build
spawn node_modules/.bin/next ENOENT`

next component

Most helpful comment

im dumb.. for me I had to yarn install

All 3 comments

Does running next build work on its own?

I am having the same error thrown when trying to use the sls command. I am using a monorepo setup with https://nx.dev/ where only one node_modules folder is present in the root directory. I suspect that the error shows because of this. How can I specify the location of my node_modules?

im dumb.. for me I had to yarn install

Was this page helpful?
0 / 5 - 0 ratings

Related issues

patricktyndall picture patricktyndall  Â·  3Comments

manojHDwork picture manojHDwork  Â·  4Comments

justinwhall picture justinwhall  Â·  5Comments

AaronMoat picture AaronMoat  Â·  3Comments

gustavorps picture gustavorps  Â·  6Comments