question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fail to deploy component, npm error

See original GitHub issue

Describe 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

  1. npx create-next-app

  2. npx serverless create --template aws-nodejs

  3. Updated serveless.yml to:

myNextApp:
  component: "@sls-next/serverless-component@1.17.0"
  1. 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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7

github_iconTop GitHub Comments

4reactions
samir-araujocommented, Nov 11, 2020

Had the same problem and could only solve with a simple workaround.

Just create an empty folder within the same path as the --prefix of npm install. In your case you would need to create this folder C:\Users\Miguel Neto\.serverless\components\registry\npm\@sls-next\serverless-component@1.17.0

After this you can run serverless again and it should work

2reactions
wavrincommented, Dec 12, 2020

Followed 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 run npx serverless successfully. Thanks.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found