Skip to content

Add "nodejs" to apt install line in Dockerfile to support Typescript scanning #44

@opsdisk

Description

@opsdisk

...otherwise, this error is generated

Initializing database at /opt/results/source_db.
Running build command: []
A fatal error occurred: Exit status 1 from command: [/usr/local/codeql-home/codeql/javascript/tools/autobuild.sh]
Error 2 executing from command.
Exiting...
Command Output: 
[2022-09-12 20:45:25] [build-stdout] Single-threaded extraction.
[2022-09-12 20:45:25] [build-stderr] Could not start Node.js. It is required for TypeScript extraction.
[2022-09-12 20:45:25] [build-stderr] Please install Node.js and ensure 'node' is on the PATH.
[2022-09-12 20:45:25] [ERROR] Spawned process exited abnormally (code 1; tried to run: [/usr/local/codeql-home/codeql/javascript/tools/autobuild.sh])

From https://trganda.github.io/posts/codeql/part-ii/#javascript-and-typescript

Creating databases for JavaScript requires no additional dependencies, but if the project includes TypeScript files, you must install Node.js 6.x or later.

Solution: Modify Dockerfile and add nodejs to the apt-get install line.

apt-get install -y --no-install-recommends \

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions