gulp: command not found - regex

when i run gulp in cmd it says gulp: command not found
though when i checked
npm root (Path Local)
/var/www/html/gus/node_modules
npm root -g (Path Global)
/Users/zohaib/npm-global/lib/node_modules
i followed these rules though these are for OsX and im having ubuntu 16.04

To install gulp in Ubuntu, mentioned below are the steps:
sudo apt-get install node
sudo apt-get install npm
sudo npm install --global gulp
sudo apt-get install nodejs-legacy
sudo npm install
Then run gulp.

Related

Unable to install Tesseract 5.0 version on AWS Lambda

I want to run Tesseract 4.0 or Tesseract 5.0 on my AWS Lambda function. So I have my docker file like so-
FROM public.ecr.aws/lambda/python:3.8
RUN mkdir app
# Copy function code
COPY / ${LAMBDA_TASK_ROOT}/app
# Install the function's dependencies using file requirements.txt
# from your project folder.
COPY requirements.txt .
RUN pip3 install -r requirements.txt --target ${LAMBDA_TASK_ROOT}
RUN rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
RUN yum -y update
RUN yum -y install tesseract
RUN yum install -y poppler-utils
# Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile)
CMD [ "app.com.emlAndMsgParser.mail_parser_test.getEmail_from_msg" ]
but when i do DockerBuild-"docker build -t qa-lambda ." on my terminal, it says Tesseract 3.0 version is getting installed. When i deploy this built Docker image to AWS Lambda,it also says Tesseract 3.0 is installed.
But I want Tesseract 4.0 or preferably Tesserct 5.0.
I tried changing the "RUN yum -y install tesseract" in my Dockerfile to "RUN yum -y install tesseract 5.0.0-alpha-320-g8dc3" and "RUN yum -y install tesseract -y" or "RUN yum -y install tesseract*".
But all of them are installing Tesseract 3.0.
Please can anyone tell me where I am going wrong?
I am a bit new to Tesseract, so any help is appreciated..thanks!
Having the same problem, I finally created a Dockerfile myself:
FROM public.ecr.aws/lambda/java:11 q
# Prepare dev tools
RUN yum -y update
RUN yum -y install wget libstdc++ autoconf automake libtool autoconf-archive pkg-config gcc gcc-c++ make libjpeg-devel libpng-devel libtiff-devel zlib-devel
RUN yum group install -y "Development Tools"
# Build leptonica
WORKDIR /opt
RUN wget http://www.leptonica.org/source/leptonica-1.82.0.tar.gz
RUN ls -la
RUN tar -zxvf leptonica-1.82.0.tar.gz
WORKDIR ./leptonica-1.82.0
RUN ./configure
RUN make -j
RUN make install
RUN cd .. && rm leptonica-1.82.0.tar.gz
# Build tesseract
RUN wget https://github.com/tesseract-ocr/tesseract/archive/refs/tags/5.2.0.tar.gz
RUN tar -zxvf 5.2.0.tar.gz
WORKDIR ./tesseract-5.2.0
RUN ./autogen.sh
RUN PKG_CONFIG_PATH=/usr/local/lib/pkgconfig LIBLEPT_HEADERSDIR=/usr/local/include ./configure --with-extra-includes=/usr/local/include --with-extra-libraries=/usr/local/lib
RUN LDFLAGS="-L/usr/local/lib" CFLAGS="-I/usr/local/include" make -j
RUN make install
RUN /sbin/ldconfig
RUN cd .. && rm 5.2.0.tar.gz
# Optional: install language packs
RUN wget https://github.com/tesseract-ocr/tessdata/raw/main/deu.traineddata
RUN wget https://github.com/tesseract-ocr/tessdata/raw/main/eng.traineddata
RUN mv *.traineddata /usr/local/share/tessdata
WORKDIR /root
ENTRYPOINT [ "tesseract", "--version" ]
Hope this helps!

How to install python-mysqldb for Python 2.7 in Ubuntu 20.04 (Focal Fossa)?

I've tried "apt-get install python-mysqldb" which results in:
root#ps1svr:~# apt-get install python-mysqldb
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package python-mysqldb is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'python-mysqldb' has no installation candidate
Note: "apt-get install python3-mysqldb" works, however I have a lot of code written for Python 2.x which no longer runs, and this is causing enough problems that I'm probably going to have to reinstall Ubuntu 18.04
Also you can just add the Ubuntu 18.04 repositoery to install the python-mysqldb package:
sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu bionic main'
sudo apt update
sudo apt install -y python-mysqldb
This will download, build and install it for all users, using pip
sudo apt install libmysqlclient-dev python2.7-dev
wget https://bootstrap.pypa.io/get-pip.py
sudo python2.7 get-pip.py
sudo wget https://raw.githubusercontent.com/paulfitz/mysql-connector-c/master/include/my_config.h -O /usr/include/mysql/my_config.h
sudo pip2 install MySQL-python
Answer found from MySQLdb install error - _mysql.c:44:23: error: my_config.h: No such file or directory

Dockerfile fails with install forever

I'm running a docker and its construction fails with this output messsage:
docker.errors.BuilError: The command '/bin/sh -c apt-get install npm'
returned a non-zero code: 1
Dockerfile has this code:
FROM ubuntu:14.04
RUN apt-get update && apt-get install -y software-properties-common
RUN apt-get install -y nodejs
RUN apt-get install npm
RUN npm install forever -g
Otherwise I can correctly execute the same commands just directy at command line outside docker's construction, and on Ubuntu 14:04.
Also I've runned another version of dockerfile without this commands, and it constructs dockers correctly.
Can you help me, please?
Thanks a lot.
I think you must pass the '-y' flag on install npm since it means 'yes' to apt-get prompt. If you look closely the other install commands already have it.

How to install AWS SAM Local on Ubuntu 16.04?

I am trying to install AWS SAM (Serverless Application Model) Local on Ubuntu 16.04.
I tried to install SAM Local using NPM with the following command.
npm install -g aws-sam-local
I got the following error.
Please help me to sort it out?
Installation on Ubuntu 16.04/18.04
sudo apt-get install python3-pip -y
sudo -H python3 -m pip install aws-sam-cli
First try
npm config set unsafe-perm=true
I also installed node v8.11.1
The standard shebang for node is #!/usr/bin/env node. There is a package conflict with the name node, so it's named nodejs.
You can solve the issue with a symlink using alternatives.
sudo update-alternatives --install /usr/bin/node node /usr/bin/nodejs 10
first try
npm install -g go-npm
then
npm install -g aws-sam-local
If issue with current user permissions, please use sudo with below commands
First try,
npm config set unsafe-perm=true
Then,
npm install -g go-npm
finally,
npm install -g aws-sam-local
It will also work for mac.

Using CxxTest with Travis-CI

Here is the portion of my .travis.yml that handles the dependency installation for my wxWidgets/CxxTest project:
install:
- echo | sudo apt-add-repository ppa:dhart/ppa
- sudo apt-get update -qq
- sudo apt-get install -qq libwxgtk2.8 cxxtest
env: CXXTEST=/usr/include
Everything installs fine, and the project builds successfully, but when it comes time to call cxxtestgen, it goes kaput.
cxxtestgen: Command not found
How do I install CxxTest onto Travis-CI while making the cxxtestgen command accessible?
Here is my github project: https://github.com/gbchaosmaster/nds-toolkit
$ sudo apt-get install -qq cxxtest
Unable to locate package cxxtest
cxxtest is not in trusted archive in ubuntu 12.04 (precise), which is used in travis-ci now (2012.11), it can't be installed there directly using command apt-get install
See https://launchpad.net/ubuntu/+source/cxxtest
Using either Ubuntu PPA or installation of cxxtest itself (like build from source)
Beside the answer, below is the way to debug in general
# .travis-ci.yml
- sudo apt-get install -qq cxxtest
env: CXXTEST=/usr/include
# Test build success and unit test passing.
script:
- dpkg -L cxxtest
- echo $PATH
- cxxtestgen