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

functions predeploy error: Command terminated with non-zero exit code 2 #1116

Closed
Nikitanagar opened this issue Nov 30, 2023 · 1 comment
Closed

Comments

@Nikitanagar
Copy link

Nikitanagar commented Nov 30, 2023

While the function deployment, I got the error shown in Image:

Screenshot 2023-11-30 174958

=== Deploying to 'securio-fleet'...

i deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run lint

lint
eslint .

Oops! Something went wrong! :(

ESLint: 8.54.0

Error [ERR_REQUIRE_ESM]: require() of ES Module C:\Users\Adevair Technologies\functions\node_modules@eslint\js\src\index.js from C:\Users\Adevair Technologies\functions\node_modules\eslint\lib\config\flat-config-array.js not supported.
index.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules.
Instead rename index.js to end in .cjs, change the requiring code to use dynamic import() which is available in all CommonJS modules, or change "type": "module" to "type": "commonjs" in C:\Users\Adevair Technologies\functions\node_modules@eslint\js\package.json to treat all .js files as CommonJS (using .mjs for all ES modules instead).

at Object.<anonymous> (C:\Users\Adevair Technologies\functions\node_modules\eslint\lib\config\flat-config-array.js:16:18)
at Object.<anonymous> (C:\Users\Adevair Technologies\functions\node_modules\eslint\lib\linter\linter.js:44:29)
at Object.<anonymous> (C:\Users\Adevair Technologies\functions\node_modules\eslint\lib\linter\index.js:3:20)
at Object.<anonymous> (C:\Users\Adevair Technologies\functions\node_modules\eslint\lib\cli-engine\cli-engine.js:37:20)
at Object.<anonymous> (C:\Users\Adevair Technologies\functions\node_modules\eslint\lib\eslint\eslint.js:16:50)
at Object.<anonymous> (C:\Users\Adevair Technologies\functions\node_modules\eslint\lib\eslint\index.js:3:20)
at Object.<anonymous> (C:\Users\Adevair Technologies\functions\node_modules\eslint\lib\cli.js:21:18)
at main (C:\Users\Adevair Technologies\functions\node_modules\eslint\bin\eslint.js:152:28)
at Object.<anonymous> (C:\Users\Adevair Technologies\functions\node_modules\eslint\bin\eslint.js:173:2)

Error: functions predeploy error: Command terminated with non-zero exit code 2

Having trouble? Try firebase [command] --help

Can anyone tells the reasons behind it.

@Nikitanagar Nikitanagar closed this as not planned Won't fix, can't repro, duplicate, stale Nov 30, 2023
@Nikitanagar Nikitanagar reopened this Dec 1, 2023
@Nikitanagar
Copy link
Author

Solved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant