Fail to deploy component, npm error
See original GitHub issueDescribe the bug
I have followed the get started steps, however the component fails to deploy. I tried the same on my mac and it work. It may be a problem with windows.
Steps to reproduce
-
npx create-next-app
-
npx serverless create --template aws-nodejs
-
Updated serveless.yml to:
myNextApp:
component: "@sls-next/serverless-component@1.17.0"
npx serverless
Screenshots/Code
error:
Error: Command failed: npm install @sls-next/serverless-component@1.17.0 --prefix C:\Users\Miguel Neto\.serverless\components\registry\npm\@sls-next\serverless-component@1.17.0
npm ERR! code ENOLOCAL
npm ERR! Could not install from "Neto\.serverless\components\registry\npm\@sls-next\serverless-component@1.17.0" as it does not contain a package.json file.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Miguel Neto\AppData\Roaming\npm-cache --global\_logs\2020-10-08T07_57_45_354Z-debug.log
at ChildProcess.exithandler (child_process.js:308:12)
at ChildProcess.emit (events.js:314:20)
at maybeClose (internal/child_process.js:1021:16)
at Socket.<anonymous> (internal/child_process.js:443:11)
at Socket.emit (events.js:314:20)
at Pipe.<anonymous> (net.js:676:12) {
killed: false,
code: 1,
signal: null,
cmd: 'npm install @sls-next/serverless-component@1.17.0 --prefix C:\\Users\\Miguel Neto\\.serverless\\components\\registry\\npm\\@sls-next\\serverless-component@1.17.0',
stdout: '',
stderr: 'npm ERR! code ENOLOCAL\n' +
'npm ERR! Could not install from "Neto\\.serverless\\components\\registry\\npm\\@sls-next\\serverless-component@1.17.0" as it does not contain a package.json file.\n' +
'\n' +
'npm ERR! A complete log of this run can be found in:\n' +
'npm ERR! C:\\Users\\Miguel Neto\\AppData\\Roaming\\npm-cache --global\\_logs\\2020-10-08T07_57_45_354Z-debug.log\n'
}
4s » Template » Error: Command failed: npm install @sls-next/serverless-component@1.17.0 --prefix C:\Users\Miguel Neto\.serverless\components\registry\npm\@sls-next\serverless-component@1.17.0
npm ERR! code ENOLOCAL
npm ERR! Could not install from "Neto\.serverless\components\registry\npm\@sls-next\serverless-component@1.17.0" as it does not contain a package.json file.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Miguel Neto\AppData\Roaming\npm-cache --global\_logs\2020-10-08T07_57_45_354Z-debug.log
- OS/Environment: @sls-next/serverless-component@1.17.0 Windows 10
Issue Analytics
- State:
- Created 3 years ago
- Comments:7
Top Results From Across the Web
NPM error when deploying react app to netlify - Stack Overflow
The issue comes from your dependency "hero-slider", which in turn specifies a peer dependency of the package styled-components as follow:
Read more >Troubleshooting Node.js Deploys - Heroku Dev Center
Your Node.js deploy failed - now what? Start with these simple steps to troubleshoot a build issue. Check the buildpack.
Read more >React Project causing npm ERR! code ERESOLVE while ...
I am trying to deploy my react app from Github auto-publishing but it causing an error ... ERESOLVE could not resolve 4:54:28 AM:...
Read more >Updated Node, NPM, React versions causing Azure DevOps ...
npm ERR ! Failed at the wanderweb-ts@0.1.0 build script. npm ERR! ... Imported via 'Components/Notifier' from file '/home/site/wwwroot/src/App.tsx'
Read more >Identify and Fix Build and Deployment Errors in Your Angular ...
This error is seen a lot because it can occur due to a variety of factors. This error occurs most commonly within your...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Had the same problem and could only solve with a simple workaround.
Just create an empty folder within the same path as the
--prefix
ofnpm install
. In your case you would need to create this folderC:\Users\Miguel Neto\.serverless\components\registry\npm\@sls-next\serverless-component@1.17.0
After this you can run
serverless
again and it should workFollowed the advice of @samir-araujo and it worked for me. Created empty folder at
.serverless\components\registry\npm\@sls-next\serverless-component@1.17.0
and was able to runnpx serverless
successfully. Thanks.