huo-ju / photoprism-freebsd-port

The photoprism port for FreeBSD
BSD 2-Clause "Simplified" License
69 stars 15 forks source link

npm error: Class extends value undefined is not a constructor or null #78

Closed gvelim closed 2 weeks ago

gvelim commented 2 weeks ago

Any ideas on how to overcome the below error during build ?

# uname -a
FreeBSD photoprism 13.3-RELEASE-p4 FreeBSD 13.3-RELEASE-p4 n257491-41f6a830f8e TRUENAS amd64
# git clone https://github.com/huo-ju/photoprism-freebsd-port
Cloning into 'photoprism-freebsd-port'...
remote: Enumerating objects: 414, done.
remote: Counting objects: 100% (124/124), done.
remote: Compressing objects: 100% (76/76), done.
remote: Total 414 (delta 55), reused 95 (delta 35), pack-reused 290 (from 1)
Receiving objects: 100% (414/414), 113.07 KiB | 5.14 MiB/s, done.
Resolving deltas: 100% (218/218), done.

# make install
===>  License AGPLv3 accepted by the user
===>   photoprism-g20240915 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by photoprism-g20240915 for building
===>  License GPLv3+ accepted by the user
===>   wget-1.24.5 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by wget-1.24.5 for building
===>  License GPLv3+ accepted by the user
===>   wget-1.24.5 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by wget-1.24.5 for building
===>  Extracting for photoprism-g20240915
=> SHA256 Checksum OK for photoprism-photoprism-g20240915-240915-e1280b2fb_GH0.tar.gz.
===>   photoprism-g20240915 depends on executable: ffmpeg - found
===>   photoprism-g20240915 depends on executable: exiftool - found
===>   photoprism-g20240915 depends on package: libheif>=1.14.2 - found
===>   photoprism-g20240915 depends on package: vips>=8.10 - found
===>   photoprism-g20240915 depends on executable: bash - found
===>   photoprism-g20240915 depends on executable: git - found
===>   photoprism-g20240915 depends on executable: gmake - found
===>   photoprism-g20240915 depends on executable: npm - found
===>   photoprism-g20240915 depends on executable: wget - found
===>   photoprism-g20240915 depends on executable: pkg-config - found
Installing Facenet model for TensorFlow...
Archive:  /tmp/photoprism/facenet.zip
   creating: assets/facenet/
 extracting: assets/facenet/saved_model.pb
Latest Facenet installed.
Installing NASNet Mobile model for TensorFlow...
Archive:  /tmp/photoprism/nasnet.zip
   creating: assets/nasnet/
 extracting: assets/nasnet/labels.txt
   creating: assets/nasnet/variables/
 extracting: assets/nasnet/variables/variables.data-00000-of-00001
 extracting: assets/nasnet/variables/variables.index
 extracting: assets/nasnet/saved_model.pb
Latest NASNet Mobile installed.
Installing NSFW model for TensorFlow...
Archive:  /tmp/photoprism/nsfw.zip
   creating: assets/nsfw/
 extracting: assets/nsfw/labels.txt
   creating: assets/nsfw/variables/
 extracting: assets/nsfw/variables/variables.data-00000-of-00001
 extracting: assets/nsfw/variables/variables.index
 extracting: assets/nsfw/saved_model.pb
Latest NSFW installed.
===>  Patching for photoprism-g20240915
===>   photoprism-g20240915 depends on executable: ffmpeg - found
===>   photoprism-g20240915 depends on executable: exiftool - found
===>   photoprism-g20240915 depends on package: libheif>=1.14.2 - found
===>   photoprism-g20240915 depends on package: vips>=8.10 - found
===>   photoprism-g20240915 depends on executable: bash - found
===>   photoprism-g20240915 depends on executable: git - found
===>   photoprism-g20240915 depends on executable: gmake - found
===>   photoprism-g20240915 depends on executable: npm - found
===>   photoprism-g20240915 depends on executable: wget - found
===>   photoprism-g20240915 depends on executable: pkg-config - found
===>   photoprism-g20240915 depends on package: gmake>=4.4.1 - found
===>   photoprism-g20240915 depends on file: /usr/local/bin/go122 - found
===>   photoprism-g20240915 depends on file: /usr/local/bin/python3.9 - found
===>   photoprism-g20240915 depends on shared library: libtensorflow.so.1 - found (/usr/local/lib/libtensorflow.so.1)
===>  Configuring for photoprism-g20240915
===>  Building for photoprism-g20240915
/bin/mkdir -p /root/photoprism-freebsd-port/work/photoprism-240915-e1280b2fb/build
/bin/mkdir -p /root/photoprism-freebsd-port/work/photoprism-240915-e1280b2fb/assets/static/build
npm error A complete log of this run can be found in: /root/.npm/_logs/2024-10-26T09_41_27_877Z-debug-0.log
*** Error code 1

Stop.
# cat /root/.npm/_logs/2024-10-26T09_30_03_380Z-debug-0.log
0 verbose cli /usr/local/bin/node /usr/local/bin/npm
1 info using npm@10.9.0
2 info using node@v18.20.4
3 silly config load:file:/usr/local/lib/node_modules/npm/npmrc
4 silly config load:file:/root/photoprism-freebsd-port/work/photoprism-240915-e1280b2fb/frontend/.npmrc
5 silly config load:file:/root/.npmrc
6 silly config load:file:/usr/local/etc/npmrc
7 verbose title npm install webpack-cli@^4.10.0
8 verbose argv "install" "--yes" "--save-dev" "webpack-cli@^4.10.0"
9 verbose logfile logs-max:10 dir:/root/.npm/_logs/2024-10-26T09_41_27_877Z-
10 verbose logfile /root/.npm/_logs/2024-10-26T09_41_27_877Z-debug-0.log
11 silly logfile done cleaning log files
12 verbose cwd /root/photoprism-freebsd-port/work/photoprism-240915-e1280b2fb/frontend
13 verbose os FreeBSD 13.3-RELEASE-p4
14 verbose node v18.20.4
15 verbose npm  v10.9.0
16 verbose exit 1
17 verbose code 1
18 error A complete log of this run can be found in: /root/.npm/_logs/2024-10-26T09_41_27_877Z-debug-0.log
gvelim commented 2 weeks ago

I think I reduced it down to 'npx' failing to run.. I have node18, npm-node18 installed

# cd ~/photoprism-freebsd-port/work/photoprism-240915-e1280b2fb/frontend

# npx
npm error Class extends value undefined is not a constructor or null
npm error A complete log of this run can be found in: /root/.npm/_logs/2024-10-26T09_57_35_767Z-debug-0.log

# cat /root/.npm/_logs/2024-10-26T09_57_35_767Z-debug-0.log
0 verbose cli /usr/local/bin/node /usr/local/lib/node_modules/npm/bin/npm-cli.js
1 info using npm@10.9.0
2 info using node@v18.20.4
3 silly config load:file:/usr/local/lib/node_modules/npm/npmrc
4 silly config load:file:/root/photoprism-freebsd-port/work/photoprism-240915-e1280b2fb/frontend/.npmrc
5 silly config load:file:/root/.npmrc
6 silly config load:file:/usr/local/etc/npmrc
7 verbose title npm exec
8 verbose argv "exec"
9 verbose logfile logs-max:10 dir:/root/.npm/_logs/2024-10-26T09_57_35_767Z-
10 verbose logfile /root/.npm/_logs/2024-10-26T09_57_35_767Z-debug-0.log
11 silly logfile start cleaning logs, removing 3 files
12 verbose stack TypeError: Class extends value undefined is not a constructor or null
12 verbose stack     at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/minipass-collect/index.js:4:23)
12 verbose stack     at Module._compile (node:internal/modules/cjs/loader:1364:14)
12 verbose stack     at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
12 verbose stack     at Module.load (node:internal/modules/cjs/loader:1203:32)
12 verbose stack     at Module._load (node:internal/modules/cjs/loader:1019:12)
12 verbose stack     at Module.require (node:internal/modules/cjs/loader:1231:19)
12 verbose stack     at require (node:internal/modules/helpers:177:18)
12 verbose stack     at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/cacache/lib/get.js:3:17)
12 verbose stack     at Module._compile (node:internal/modules/cjs/loader:1364:14)
12 verbose stack     at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
13 error Class extends value undefined is not a constructor or null
14 verbose cwd /root/photoprism-freebsd-port/work/photoprism-240915-e1280b2fb/frontend
15 verbose os FreeBSD 13.3-RELEASE-p4
16 verbose node v18.20.4
17 verbose npm  v10.9.0
18 verbose exit 1
19 verbose code 1
20 error A complete log of this run can be found in: /root/.npm/_logs/2024-10-26T09_57_35_767Z-debug-0.log
gvelim commented 2 weeks ago

That has fixed it !

# pkg remove npm-node18 node18
# rm -R /usr/local/lib/node_modules
# rm -R .npm
# pkg install npm-node18 node18