snorreks / nx-cloud-functions-deployer

Plugin for Nx that adds support for deploying Cloud Functions for Firebase.
MIT License
6 stars 1 forks source link

Error: spawn node ENOENT #5

Closed mostafa-tarek10 closed 6 months ago

mostafa-tarek10 commented 6 months ago

at ChildProcess._handle.onexit (node:internal/child_process:286:19) at onErrorNT (node:internal/child_process:484:16) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { errno: -2, code: 'ENOENT', syscall: 'spawn node', path: 'node', spawnargs: [ '--no-warnings', '--import', 'tsx', '****' ] } I got this error when trying to deploy.

snorreks commented 6 months ago

I can see that this error is relating to the runFile function. And runFile function is only used when:

Using online checksum is optional, and will be safely caught in a try catch so it should not stop you from deploying. Maybe you have another error? Can you run with --verbose?

mostafa-tarek10 commented 6 months ago

Hello @snorreks, I wanted to let you know that I'm aware of the online checksum using JSONbin, and I have already set it up following the provided instructions.

However, I encountered an error while using it. Even though the deployers seem to be functioning properly, I was hoping to benefit from the centralized caching in the ci/cd process.

Here are the logs generated when I ran the process with the '--verbose' option:

RunStart duration: 496

runCommand { command: 'node', commandArguments: [ '--no-warnings', '--import', 'tsx', '/home/mostafa/Documents/Firebase-NX/tmp/apps/casivu/read.ts' ], cwd: '/home/mostafa/Documents/Firebase-NX/tmp/apps/casivu', environment: { FLAVOR: 'development', SENTRY_DSN: '@@@#', FIREBASE_SERVICE_ACCOUNT: '{ "type": "service_account",' }, silent: false }

Executing "node --no-warnings --import tsx /home/mostafa/Documents/Firebase-NX/tmp/apps/casivu/read.ts"...

node: internal/errors:496 ErrorCaptureStackTrace(err); ^

TypeError [ERR_UNKNOWN_FILE_EXTENSION]: The file extension ".ts" for /home/mostafa/Documents/Firebase-NX/tmp/apps/casivu/read.ts is unknown. at __node_internal_captureLargerStackTrace (node:internal/errors:496:5) at new NodeError (node: internal/errors:405:5) at Object.getFileProtocolModuleFormat [as file:] (node: internal/modules/esm/get_format:136:11) at defaultGetFormat (node: internal/modules/esm/get_format:182:36) at defaultLoad (node:internal/modules/esm/load:101:20) at ModuleLoader.load (node:internal/modules/esm/loader:416:13) at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:287:22) at new ModuleJob (node:internal/modules/esm/module_job:63:26) at #createModuleJob (node:internal/modules/esm/loader:311:17) at ModuleLoader.getJobFromResolveResult (node:internal/modules/esm/loader:264:34) at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:250:17) at async ModuleLoader.import (node:internal/modules/esm/loader:335:23) at async loadESM (node:internal/process/esm_loader:34:7) at async handleMainPromise (node:internal/modules/run_main:106:12) { code: 'ERR_UNKNOWN_FILE_EXTENSION' }

Node.js v18.19.0 Error: The command "node --no-warnings --import tsx /home/mostafa/Documents/Firebase-NX/tmp/apps/casivu/read.ts" failed with an exit code of 1. at ChildProcess. (/home/mostafa/Documents/Firebase-NX/node_modules/.pnpm/nx-cloud-functions-deployer@2.4.1_tsx@3.14.0/node_modules/nx-cloud-functions-deployer/executors/deploy/index.js:2:7575) at ChildProcess.emit (node:events:517:28) at ChildProcess._handle.onexit (node:internal/child_process:292:12)

seems like this error is with node can't read .ts file inside subprocess

mostafa-tarek10 commented 6 months ago

solved