Possible Line Ending Issues when building DataTablesSrc and extensions
Possible Line Ending Issues when building DataTablesSrc and extensions

Hello! I was going to ask for help regarding building the project, but ended up figuring things out myself and stumbling on an issue I wanted to "expose" so people trying to add content to DataTables won't be as lost as I was for days.
TLDR:
1. Remember that GitHub Desktop and other windows programs may change your code's line endings from LF (unix) to CRLF (windows). As the DT build process is not supported on Windows outside WSL, The makefiles WILL NOT RUN on CRLF.
2. There's a lot of dependency-related warnings upon dependency installation with npm install
.
I'm trying to add a new feature to the ColumnControl extension, as per this post.
To test it, I'm trying to build both the source Datatables code and the forked ColumnControl (updated with the feature) which has the dt package as a dependency. I'm building on WSL. I've tried to build on both Ubuntu WSL and Ubuntu WSL through the VS Code Terminal, as the build process is said to support WSL.
Building DT
I've tried to follow the instructions below, found in the Building section of the repo:
I used GitHub Desktop for the cloning process but otherwise followed the instructions to the letter.
git clone https://github.com/DataTables/DataTablesSrc.git
cd DataTablesSrc
npm install
npm run build-debug
npm serve
Ubuntu and the packages are fully updated. The required software's versions are as follows:
- NPM: 10.9.2
- Bash: GNU bash, version 5.2.21(1)-release
- Node.js: v18.19.1
- PHP: 8.3.6 (cli)
When I run npm install
, I get a message detailing multiple package issues (sample above), ending in the following:
added 879 packages, and audited 880 packages in 4m
78 packages are looking for funding
run `npm fund` for details
71 vulnerabilities (4 low, 13 moderate, 36 high, 18 critical)
To address issues that do not require attention, run:
npm audit fix
To address all issues possible (including breaking changes), run:
npm audit fix --force
Some issues need review, and may require choosing
a different dependency.
Run `npm audit` for details.
Even when running npm audit fix
or npm audit fix --force
there are still about 48 vulnerabilities left (I tested this out on a previous cloned DataTablesSrc), some critical. When running npm audit
, the message does not give me any further information than what was already in the previous npm install
message.
Following that, once I run npm run build
or npm run build-debug
, it does not recognize the makefile on the /build
folder:
> datatables.net-src@2.0.5 build-debug
> cd build; ./make.sh build debug
sh: 1: ./make.sh: not found
I got around that issue by running the code myself, using make
rather than ./make.sh
, following the reference on the automatically created package.json
file (see above):
cd build
make build debug
However, it does not recognize build
as a target (make: *** No rule to make target 'build'. Stop.
). The same happens if I try to build the extension with make extension ColumnControl build debug
(message: make: *** No rule to make target 'extension'. Stop.
). Why?
Building Extension
To build the extension, I tried to install datatables.net
separately (as is its dependency). Running make
on the ColumnControl
directory returns the same type of message as the previous section's (make: *** No rule to make target 'build'. Stop
).
Looking for Bash and Make's PATHS
which bash
returns /usr/bin/bash
which make
returns /usr/bin/make
All looks okay.
Conclusion
I was unable to replicate this (though I think I used the bash
command to run the makefile), but yesterday to try and debug my code I added echo $1 $2
to the makefiles to try and see if the issue was related to the directories they were reading from. I got the message $'\r': command not found
.
Some research took me to the AskUbuntu forum where I realized that - yup, my line endings were all currently set to CRLF.
So all I had to do was clone the repos again and run the commands according to the instructions. I was afraid I'd messed up the original ColumnControl repo until I remembered I'd set my GitHub Desktop settings to "Checkout Windows-style, commit Unix-style" and had several commits done already.
Finally, it lets me build.