Description
Please make sure that this is a build/installation issue. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template
System information
- OS Platform and Distribution (e.g., Linux Ubuntu 22.04):
- Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:
- Dockerfile amd docker compose provided to install exact items used
*Describe the problem
tfjs example fails to run as expected resuling in following error:
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
Provide the exact sequence of commands / steps that you executed before running into the problem
clone the tfjs-examples
$ mkdir dui
$ cd dui
$ git clone https://github.com/tensorflow/tfjs.git
create docker/Dockerfile
FROM ubuntu:22.04
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y \
&& apt-get install -y python3-pip cmake wget curl git \
&& python3 -m pip install --upgrade pip
RUN apt-get -qq install -y python3-numpy python3-opencv
# Install PIP libs
RUN pip3 install jupyter onnxruntime tensorflow openvino matplotlib dlib
# nvm env vars
RUN mkdir -p /usr/local/nvm
ENV NVM_DIR /usr/local/nvm
# IMPORTANT: set the exact version
#ENV NODE_VERSION v23.6.0
ENV NODE_VERSION v20.11.1
# Install latest nvm
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
RUN /bin/bash -c "source $NVM_DIR/nvm.sh && nvm install $NODE_VERSION && nvm use --delete-prefix $NODE_VERSION"
# add node and npm to the PATH
ENV NODE_PATH $NVM_DIR/versions/node/$NODE_VERSION/bin
ENV PATH $NODE_PATH:$PATH
RUN npm -v
RUN node -v
RUN npm install --global yarn
# local to project ??
#RUN npx expo install react-dom react-native-web @expo/metro-runtime
EXPOSE 8888 8081
WORKDIR /workdir
CMD /bin/bash
create docker/docker-compose.yml
version: '3.8'
services:
react_native_ubuntu22:
image: react_native_ubuntu22
container_name: react_native_ubuntu22
build:
context: .
dockerfile: Dockerfile
#devices:
# - /dev/video0:/dev/video0
ports:
- 8080:8080
- 8888:8888
- 8081:8081
expose:
- 8080
- 8888
- 8081
volumes:
- ../../:/workdir
working_dir: /workdir/dui/tfjs-examples/react-native/image-classification/react-native-cli/
command: yarn start
boot the docker image and Install the yarn dependencies
$ docker-compose -f docker/docker-compose.yml run --rm react_native_ubuntu22 bash
root@54c981665153:/workdir/dui/tfjs-examples/react-native/image-classification/react-native-cli# yarn
the yarn dependencies install proceeds as follows
yarn install v1.22.22
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning "@tensorflow/tfjs > @tensorflow/tfjs-data@3.9.0" has unmet peer dependency "seedrandom@~2.4.3".
warning " > @tensorflow/tfjs-react-native@0.7.0" has unmet peer dependency "@tensorflow/tfjs-backend-cpu@~3.7.0".
warning " > @tensorflow/tfjs-react-native@0.7.0" has unmet peer dependency "@tensorflow/tfjs-backend-webgl@~3.7.0".
warning " > @tensorflow/tfjs-react-native@0.7.0" has unmet peer dependency "@tensorflow/tfjs-core@~3.7.0".
warning " > @tensorflow/tfjs-react-native@0.7.0" has unmet peer dependency "expo-asset@^7.0.0".
warning " > @tensorflow/tfjs-react-native@0.7.0" has incorrect peer dependency "expo-camera@^7.0.0".
warning " > @tensorflow/tfjs-react-native@0.7.0" has incorrect peer dependency "expo-gl@^7.0.0".
warning " > @tensorflow/tfjs-react-native@0.7.0" has incorrect peer dependency "react@^16.12.0".
warning " > @tensorflow-models/mobilenet@2.1.0" has unmet peer dependency "@tensorflow/tfjs-converter@^3.1.0".
warning " > @tensorflow-models/mobilenet@2.1.0" has unmet peer dependency "@tensorflow/tfjs-core@^3.1.0".
warning "expo-camera > @koale/useworker@3.4.0" has incorrect peer dependency "react@^16.8.0".
warning " > react-native@0.64.1" has incorrect peer dependency "react@17.0.1".
warning "react-native-codegen > jscodeshift@0.11.0" has unmet peer dependency "@babel/preset-env@^7.1.6".
warning " > react-native-fs@2.14.1" has unmet peer dependency "prop-types@^15.6.0".
warning " > react-native-fs@2.14.1" has incorrect peer dependency "react@^16.2.0".
[4/4] Building fresh packages...
Done in 222.89s.
root@54c981665153:/workdir/dui/tfjs-examples/react-native/image-classification/react-native-cli#
exit
Exit the docker bash shell and run the project as a server
$ docker-compose -f docker/docker-compose.yml up react_native_ubuntu22
execution proceeds as follows:
Recreating react_native_ubuntu22 ... done
Attaching to react_native_ubuntu22
react_native_ubuntu22 | yarn run v1.22.22
react_native_ubuntu22 | $ react-native start
react_native_ubuntu22 |
react_native_ubuntu22 | #######
react_native_ubuntu22 | ################
react_native_ubuntu22 | ######### #########
react_native_ubuntu22 | ######### ##########
react_native_ubuntu22 | ######### ###### #########
react_native_ubuntu22 | ##########################################
react_native_ubuntu22 | ##### ##################### #####
react_native_ubuntu22 | ##### ############## #####
react_native_ubuntu22 | ##### ### ###### ### #####
react_native_ubuntu22 | ##### ####### ####### #####
react_native_ubuntu22 | ##### ########### ########### #####
react_native_ubuntu22 | ##### ########################## #####
react_native_ubuntu22 | ##### ########################## #####
react_native_ubuntu22 | ##### ###################### ######
react_native_ubuntu22 | ###### ############# #######
react_native_ubuntu22 | ######### #### #########
react_native_ubuntu22 | ######### #########
react_native_ubuntu22 | ######### #########
react_native_ubuntu22 | #########
react_native_ubuntu22 |
react_native_ubuntu22 |
react_native_ubuntu22 | Welcome to Metro!
react_native_ubuntu22 | Fast - Scalable - Integrated
react_native_ubuntu22 |
react_native_ubuntu22 |
react_native_ubuntu22 | Failed to construct transformer: Error: error:0308010C:digital envelope routines::unsupported
react_native_ubuntu22 | at new Hash (node:internal/crypto/hash:68:19)
react_native_ubuntu22 | at Object.createHash (node:crypto:138:10)
react_native_ubuntu22 | at stableHash (/workdir/dui/tfjs-examples/react-native/image-classification/react-native-cli/node_modules/metro-cache/src/stableHash.js:19:8)
react_native_ubuntu22 | at Object.getCacheKey (/workdir/dui/tfjs-examples/react-native/image-classification/react-native-cli/node_modules/metro-transform-worker/src/index.js:647:7)
react_native_ubuntu22 | at getTransformCacheKey (/workdir/dui/tfjs-examples/react-native/image-classification/react-native-cli/node_modules/metro/src/DeltaBundler/getTransformCacheKey.js:32:19)
react_native_ubuntu22 | at new Transformer (/workdir/dui/tfjs-examples/react-native/image-classification/react-native-cli/node_modules/metro/src/DeltaBundler/Transformer.js:180:28)
react_native_ubuntu22 | at /workdir/dui/tfjs-examples/react-native/image-classification/react-native-cli/node_modules/metro/src/Bundler.js:58:29 {
react_native_ubuntu22 | opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
react_native_ubuntu22 | library: 'digital envelope routines',
react_native_ubuntu22 | reason: 'unsupported',
react_native_ubuntu22 | code: 'ERR_OSSL_EVP_UNSUPPORTED'
react_native_ubuntu22 | }
Any other info / logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.