Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: yarn install --frozen-lockfile --non-interactive failed with code 1 #1653

Open
juztinlazaro opened this issue Nov 14, 2023 · 4 comments

Comments

@juztinlazaro
Copy link

juztinlazaro commented Nov 14, 2023

any fix on this? also having an issue in

issue:

× Stack *****-serverless-sit failed to deploy (6s)
Environment: linux, node 18.12.1, framework 3.36.0 (local), plugin 7.1.0, SDK 4.4.0
Credentials: Local, environment variables
Docs:        docs.serverless.com
Support:     forum.serverless.com
Bugs:        github.com/serverless/serverless/issues

Error:
Error: yarn install --frozen-lockfile --non-interactive failed with code 1
    at ChildProcess.<anonymous> (/home/circleci/project/node_modules/serverless-webpack/lib/utils.js:92:16)
    at ChildProcess.emit (node:events:513:28)
    at ChildProcess.emit (node:domain:489:12)
    at maybeClose (node:internal/child_process:1091:16)
    at ChildProcess._handle.onexit (node:internal/child_process:302:5)

2 deprecations found: run 'serverless doctor' for more details

custom

webpack:
  webpackConfig: serverless_v3/webpack.config.js
  includeModules:
    forceInclude:
      - lodash
      - moment
      - es6-promisify
      - axios
      - https
      - axios-retry
      - error-stack-parser
      - stackframe
      - stack-generator
      - stacktrace-gps
      - '@loanmarket/logger-core'
      - '@loanmarket/logger-cloud-watch'
  packager: 'yarn'

webpackconfig

const path = require('path');
const slsw = require('serverless-webpack');
const nodeExternals = require('webpack-node-externals');

module.exports = {
  entry: slsw.lib.entries,
  target: 'node',
  mode: slsw.lib.webpack.isLocal ? 'development' : 'production',
  resolve: {
    alias: {
      lib: path.resolve(__dirname, 'lib/'),
      services: path.resolve(__dirname, 'services/'),
      builders: path.resolve(__dirname, 'builders/'),
      constants: path.resolve(__dirname, 'constants/'),
      config: path.resolve(__dirname, 'config/'),
      shared: path.resolve(__dirname, '../shared/'),
    },
  },
  optimization: {
    // We no not want to minimize our code.
    minimize: false,
  },
  performance: {
    // Turn off size warnings for entry points
    hints: false,
  },
  devtool: 'nosources-source-map',
  externals: [nodeExternals()],
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        use: [
          {
            loader: 'babel-loader',
          },
        ],
      },
    ],
  },
  output: {
    libraryTarget: 'commonjs2',
    path: path.join(__dirname, '.webpack'),
    filename: '[name].js',
    sourceMapFilename: '[file].map',
  },
};

Serverless-Webpack Version you're using: "serverless-webpack": "5.3.0",
Webpack version you're using: "webpack": "5.81.0",
Serverless Framework Version you're using: "serverless": "3.36.0",

@j0k3r
Copy link
Member

j0k3r commented Nov 14, 2023

Can you run yarn install --frozen-lockfile --non-interactive locally to see how it goes?

@juztinlazaro
Copy link
Author

Hi @j0k3r running locally

$ yarn install --frozen-lockfile --non-interactive
yarn install v1.22.19
[1/4] 🔍  Resolving packages...
warning Resolution field "xml2js@0.5.0" is incompatible with requested version "xml2js@0.4.19"
warning Resolution field "json5@1.0.2" is incompatible with requested version "json5@^2.1.2"
warning Resolution field "follow-redirects@1.14.8" is incompatible with requested version "follow-redirects@1.5.10"
warning Resolution field "minimatch@3.0.5" is incompatible with requested version "minimatch@^3.1.1"
warning Resolution field "is-svg@4.3.0" is incompatible with requested version "is-svg@^2.0.0"
warning Resolution field "minimatch@3.0.5" is incompatible with requested version "minimatch@^5.0.1"
warning Resolution field "json5@1.0.2" is incompatible with requested version "json5@^2.2.3"
warning Resolution field "json5@1.0.2" is incompatible with requested version "json5@^0.5.1"
warning Resolution field "minimatch@3.0.5" is incompatible with requested version "minimatch@^3.1.2"
warning Resolution field "tar@6.1.9" is incompatible with requested version "tar@6.0.2"
warning Resolution field "minimatch@3.0.5" is incompatible with requested version "minimatch@3.0.4"
warning Resolution field "minimatch@3.0.5" is incompatible with requested version "minimatch@3.0.4"
warning Resolution field "flat@5.0.1" is incompatible with requested version "flat@^4.1.0"
warning Resolution field "degenerator@3.0.1" is incompatible with requested version "degenerator@^2.2.0"
warning Resolution field "minimist@1.2.6" is incompatible with requested version "minimist@0.0.8"
warning Resolution field "xml2js@0.5.0" is incompatible with requested version "xml2js@~0.4.1"
warning Resolution field "json5@1.0.2" is incompatible with requested version "json5@^2.1.2"
warning Resolution field "tar@6.1.9" is incompatible with requested version "tar@^6.1.15"
warning Resolution field "flat@5.0.1" is incompatible with requested version "flat@^5.0.2"
warning Resolution field "minimatch@3.0.5" is incompatible with requested version "minimatch@^5.1.0"
warning Resolution field "minimist@1.2.6" is incompatible with requested version "minimist@1.1.x"
success Already up-to-date.
✨  Done in 1.06s.

@juztinlazaro
Copy link
Author

Hi @j0k3r i notice the error came up when include the private dependecy in forceInclude

  - '@loanmarket/logger-core'
  - '@loanmarket/logger-cloud-watch'

@davecoffin
Copy link

I just ran into this. I was using a package without it being installed, and it works in dev because some other package depended on it. But when webpacking, it shakes it out. So make sure you are including all packages you are importing from explicitly in package.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants