DataTablesSrc icon indicating copy to clipboard operation
DataTablesSrc copied to clipboard

Various issues when attempting to build datatables with npm run build

Open MisterVector opened this issue 6 months ago • 4 comments

For starters my environment is windows 11 and I am presently using PHP 8.2.12 with XAMPP.

The following is output from the command php -m:

C:\Windows\System32>php -m
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gettext
hash
iconv
intl
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
random
readline
Reflection
session
SimpleXML
SPL
standard
tidy
tokenizer
xml
xmlreader
xmlwriter
zlib

[Zend Modules]

Currently, using npm run build does not give me error messages that are useful. Here is the message that I get when I run it:

$ npm run build

> [email protected] build
> cd build; ./make.sh build

The system cannot find the path specified.

I will refer to the ./make.sh build command in the build/ directory which gives me relevant errors.

Running this command produces the following error:

$ ./make.sh build

  DataTables build () - branch: master

Error: php's xml module is not installed and is required to build the examples.
  Install with 'sudo apt install php-xml' or similar for your platform

XML is already loaded as a module. I understand that XML comes with PHP by default and is no longer required to be an extension. See: https://www.php.net/manual/en/xml.installation.php

If I comment out the check for the XML extension (code) I get the following error:

$ ./make.sh build

  DataTables build () - branch: master

Error: php's mbstring module is not installed and is required to build the examples.
  Install with 'sudo apt install php-mbstring' or similar for your platform

This module was listed in the output for php -m.

If I additionally comment out the check for the mbstring extension (code) I get the following:

$ ./make.sh build

  DataTables build () - branch: master

Error: php's curl module is not installed and is required to build the examples.
  Install with 'sudo apt install php-curl' or similar for your platform

Curl was also listed as one of the loaded modules.

If I additionally comment out the check for the curl module (code), I will get the following warning:

$ ./make.sh build

  DataTables build () - branch: master

Warning: php's tidy module is not installed and is used to clean up build the examples.
  Install with 'sudo apt install php-tidy' or similar for your platform
Warning: Neither Chrome nor Chromium is installed, and is used for the unit tests.
  Install with 'sudo apt install chromium-browser' or similar for your platform

However, the build script will run and produce the output files. A bunch of SASS warnings will show up too, but that doesn't break the output script. Also a number of these warnings too:

Path - Empty to (E:/Projects/Forks/DataTablesSrc/build/../built/examples/server_side/pipeline.html)

MisterVector avatar May 30 '25 00:05 MisterVector

I used php -i to check for the modules, but php -m is much better - thanks for pointing that option out. I've committed a change to address that.

I assume you are running this under WSL?

AllanJard avatar May 30 '25 08:05 AllanJard

I am not using WSL, no. Just running Apache from XAMPP which is supplying PHP.

MisterVector avatar May 30 '25 21:05 MisterVector

The build process uses bash, so I'm surprised it runs at all on Windows! I'll grab a Windows machine at some point, but WSL might be the way forward if you need to build it on Windows.

AllanJard avatar May 31 '25 07:05 AllanJard

I'm actually using git bash so yeah, it does execute the build script.

MisterVector avatar Jun 01 '25 05:06 MisterVector

Can we migrate all the ./make.sh scripts to the Node platform? Add a new JS file in the scripts to execute the build process, since Node has many cross-platform packages that can handle the tasks well and make it easy to run build tasks on Windows too.

ajiho avatar Aug 09 '25 09:08 ajiho