aws-amplify / amplify-js

A declarative JavaScript library for application development using cloud services.
https://docs.amplify.aws/lib/q/platform/js
Apache License 2.0
9.43k stars 2.13k forks source link

Next.js 12 SSR - Error: Command failed: npm install @sls-next/-component@3.7.0 --prefix /root/./ #10049

Closed adammathieson closed 2 years ago

adammathieson commented 2 years ago

Before opening, please confirm:

Region

us-west-2

JavaScript Framework

Next.js

Amplify APIs

Not applicable

Amplify Categories

Not applicable

Environment information

``` # Put output below this line System: OS: macOS 11.6.7 CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz Memory: 560.96 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 16.15.0 - ~/.nvm/versions/node/v16.15.0/bin/node Yarn: 1.21.1 - /usr/local/bin/yarn npm: 8.5.5 - ~/.nvm/versions/node/v16.15.0/bin/npm Browsers: Chrome: 103.0.5060.53 Edge: 103.0.1264.44 Firefox: 101.0.1 Safari: 15.5 npmPackages: @ampproject/toolbox-optimizer: undefined () @babel/core: undefined () @babel/runtime: 7.15.4 @edge-runtime/primitives: 1.1.0-beta.10 @hapi/accept: undefined () @napi-rs/triples: undefined () @next/react-dev-overlay: undefined () @vercel/nft: undefined () acorn: undefined () amphtml-validator: undefined () arg: undefined () assert: undefined () async-retry: undefined () async-sema: undefined () babel-packages: undefined () browserify-zlib: undefined () browserslist: undefined () buffer: undefined () bytes: undefined () chalk: undefined () ci-info: undefined () cli-select: undefined () comment-json: undefined () compression: undefined () conf: undefined () constants-browserify: undefined () content-disposition: undefined () content-type: undefined () cookie: undefined () cross-spawn: undefined () crypto-browserify: undefined () cssnano-simple: undefined () debug: undefined () devalue: undefined () domain-browser: undefined () edge-runtime: undefined () eslint: 8.18.0 => 8.18.0 eslint-config-next: 12.2.0 => 12.2.0 etag: undefined () events: undefined () find-cache-dir: undefined () find-up: undefined () fresh: undefined () get-orientation: undefined () glob: undefined () gzip-size: undefined () http-proxy: undefined () https-browserify: undefined () icss-utils: undefined () ignore-loader: undefined () image-size: undefined () is-animated: undefined () is-docker: undefined () is-wsl: undefined () jest-worker: undefined () json5: undefined () jsonwebtoken: undefined () loader-utils: undefined () lodash.curry: undefined () lru-cache: undefined () micromatch: undefined () mini-css-extract-plugin: undefined () nanoid: undefined () native-url: undefined () neo-async: undefined () next: 12.2.0 => 12.2.0 node-fetch: undefined () node-html-parser: undefined () ora: undefined () os-browserify: undefined () p-limit: undefined () path-browserify: undefined () postcss-flexbugs-fixes: undefined () postcss-modules-extract-imports: undefined () postcss-modules-local-by-default: undefined () postcss-modules-scope: undefined () postcss-modules-values: undefined () postcss-preset-env: undefined () postcss-safe-parser: undefined () postcss-scss: undefined () postcss-value-parser: undefined () process: undefined () punycode: undefined () querystring-es3: undefined () raw-body: undefined () react: 18.2.0 => 18.2.0 react-dom: 18.2.0 => 18.2.0 react-is: 17.0.2 react-refresh: 0.12.0 react-server-dom-webpack: undefined () regenerator-runtime: 0.13.4 sass-loader: undefined () schema-utils: undefined () semver: undefined () send: undefined () setimmediate: undefined () source-map: undefined () stream-browserify: undefined () stream-http: undefined () string-hash: undefined () string_decoder: undefined () strip-ansi: undefined () tar: undefined () terser: undefined () text-table: undefined () timers-browserify: undefined () tty-browserify: undefined () ua-parser-js: undefined () unistore: undefined () util: undefined () vm-browserify: undefined () watchpack: undefined () web-vitals: undefined () webpack: undefined () webpack-sources: undefined () ws: undefined () npmGlobalPackages: @aws-amplify/cli: 9.0.0 corepack: 0.10.0 npm: 8.5.5 serverless: 3.16.0 ```

Describe the bug

During build: amplify fails build do to "Error: Command failed: npm install @sls-next/-component@3.7.0 --prefix /root/./

Screen Shot 2022-06-30 at 2 20 49 PM

Expected behavior

The build should have been completed without error

Reproduction steps

  1. Create a new next.js project by running create-next-app app-name --use-npm
  2. Create a GitHub repository and push the project code to main branch
  3. In the Amplify console -> All apps -> select New app -> Host web app -> and choose GitHub under "From your existing code" section, then select the repository and main branch for the app
  4. App build will fail

Additional information and screenshots

The problem first occurred on June 30, 2022, while making minor changes to a development branch of a different project, which triggered an automatic rebuild. I tried creating a feature branch off of the last successfully built branch version, but that failed as well. And then received the same error after starting a new create next.js project and deploying it as a separate app in Amplify.

ciceropablo commented 2 years ago

I have the same problem. 🤦🏾‍♂️

ecasanova commented 2 years ago

I have the same problem.

adammathieson commented 2 years ago

I could be missing something, but I can't find any reference to "@sls-next/-component@3.7.0"

Is the dependency supposed to be "@sls-next/serverless-component@3.7.0"?

ecasanova commented 2 years ago

In my case, the error is solved, but I don't do anything

chrisbonifacio commented 2 years ago

Is anyone still experiencing this issue?

ciceropablo commented 2 years ago

Hi @chrisbonifacio! I'm doing some tests, but it seems to have been resolved.

adammathieson commented 2 years ago

Hi @chrisbonifacio Just completed a successful build on a test branch. Rebuilding the original branch now, but it appears to be working.

dbanksdesign commented 2 years ago

This was an issue with Amplify Hosting and due to the npm outage today where certain package versions were not published, breaking a lot CI/CD tools. It is resolved now.

Brew-Brew commented 1 year ago
스크린샷 2023-01-06 오후 4 52 57

this issue happen again, anyone can help fix this issue..?

abdallahshaban557 commented 1 year ago

Hi @Brew-Brew - can you please open a new Github issue so that we can investigate this further?

richardvanderdys commented 1 year ago

I just got this today. Was this ever solved?

70ki8suda commented 1 year ago

got this today suddenly

suzu1997 commented 1 year ago

Today, a problem similar to the one here occurred.

Is this also an issue with Amplify Hosting? Please confirm, and thank you in advance.

error

2023-09-14T09:28:07.321Z [INFO]: Starting SSR Build...
2023-09-14T09:29:20.594Z [ERROR]: Error: Command failed: npm install @sls-next/-component@3.7.0 --prefix /root/./
                                  npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
                                  npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
                                  npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
                                  npm WARN deprecated uuid@3.3.2: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
                                  npm WARN deprecated uuid@3.3.2: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
                                  npm WARN deprecated uuid@3.3.2: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
                                  npm WARN deprecated uuid@3.3.2: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
                                  npm WARN deprecated uuid@3.3.2: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
                                  npm WARN deprecated uuid@3.3.2: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
                                  npm WARN deprecated uuid@3.3.2: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
                                  npm WARN deprecated uuid@3.3.2: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
                                  npm WARN deprecated node-pre-gyp@0.13.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
                                  npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
                                  npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
                                  npm ERR! code ERR_SOCKET_TIMEOUT
                                  npm ERR! network Socket timeout
                                  npm ERR! network This is a problem related to network connectivity.
                                  npm ERR! network In most cases you are behind a proxy or have bad network settings.
                                  npm ERR! network
                                  npm ERR! network If you are behind a proxy, please make sure that the
                                  npm ERR! network 'proxy' config is set properly.  See: 'npm help config'
                                  npm ERR! A complete log of this run can be found in:
                                  npm ERR!     /root/.npm/_logs/2023-09-14T09_29_18_977Z-debug.log
                                  at ChildProcess.exithandler (node:child_process:397:12)
                                  at ChildProcess.emit (node:events:390:28)
                                  at maybeClose (node:internal/child_process:1064:16)
                                  at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5) {
                                  killed: false,
                                  code: 1,
                                  signal: null,
                                  cmd: 'npm install @sls-next/-component@3.7.0 --prefix /root/./',
                                  stdout: '',
                                  stderr: 'npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated\n' +
                                  'npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated\n' +
                                  'npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.\n' +
                                  'npm WARN deprecated uuid@3.3.2: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.\n' +
                                  'npm WARN deprecated uuid@3.3.2: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.\n' +
                                  'npm WARN deprecated uuid@3.3.2: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.\n' +
                                  'npm WARN deprecated uuid@3.3.2: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.\n' +
                                  'npm WARN deprecated uuid@3.3.2: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.\n' +
                                  'npm WARN deprecated uuid@3.3.2: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.\n' +
                                  'npm WARN deprecated uuid@3.3.2: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.\n' +
                                  'npm WARN deprecated uuid@3.3.2: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.\n' +
                                  'npm WARN deprecated node-pre-gyp@0.13.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future\n' +
                                  'npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated\n' +
                                  'npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated\n' +
                                  'npm ERR! code ERR_SOCKET_TIMEOUT\n' +
                                  'npm ERR! network Socket timeout\n' +
                                  'npm ERR! network This is a problem related to network connectivity.\n' +
                                  'npm ERR! network In most cases you are behind a proxy or have bad network settings.\n' +
                                  'npm ERR! network \n' +
                                  'npm ERR! network If you are behind a proxy, please make sure that the\n' +
                                  "npm ERR! network 'proxy' config is set properly.  See: 'npm help config'\n" +
                                  '\n' +
                                  'npm ERR! A complete log of this run can be found in:\n' +
                                  'npm ERR!     /root/.npm/_logs/2023-09-14T09_29_18_977Z-debug.log\n'
                                  }
2023-09-14T09:29:20.594Z [HELP]: Outputting the npm debug log
                                 [object Promise]
                                 Outputting the npm debug log
                                 [object Promise]
**Next.js version** : 11

**Node.js version**: 16.13.0

Untitled