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`
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
Most helpful comment
im dumb.. for me I had to
yarn install