How to install node-xmpp on Ubuntu.
Dependencies node.js
sudo aptitude install build-essential
sudo apt-get install libssl-dev
Install node.js & npm the correct way
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install
curl http://npmjs.org/install.sh | sh
Install node-xmpp dependencies
sudo apt-get install libexpat1 libexpat1-dev
npm install node-expat
sudo apt-get install libicu-dev
npm install node-stringprep
install node-xmpp
npm install node-xmpp
Related
im using laravel 8 and vuejs to create my website
i have this error after run npm run dev command:
Error: Cannot find module 'semver'
Require stack:
- /usr/share/npm/lib/utils/unsupported.js
- /usr/share/npm/bin/npm-cli.js
...
id tried this solutions:
sudo apt-get purge nodejs --auto-remove
sudo apt-get purge npm --auto-remove
sudo rm -rf /usr/local/bin/npm /usr/local/share/man/man1/node* ~/.npm
sudo rm -rf /usr/local/lib/node*
sudo rm -rf /usr/local/bin/node*
sudo rm -rf /usr/local/include/node*
sudo apt-get purge nodejs npm
sudo apt autoremove
npm i -g semver
and then installed again the nodejs and npm (latest version)
but the error still exist
what should i do
There are some modules missing in your /usr/share/npm.
So this will I guess solve the problem
cd /usr/share/npm; npm i
If this doesn't work then you can also just go on installing each missing module in /usr/share/npm.
just try to install npm globally , it will install latest version of npm
sudo npm install -g npm
it worked for me.
The error is basically saying you are missing the module, so you need to install it this way :
npm install semver
I am trying to create a centos image with latest node.js LTS version and a npm package. Everything works until the npm command which then fails with the following error:
> [5/5] RUN npm install -g express-generator-typescript:
#8 1.928 /bin/sh: npm: command not found
Here is my Dockerfile:
FROM centos
RUN touch $HOME/.bashrc && \
yum -y install tar gzip gunzip
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash \
&& . $HOME/.bashrc \
&& nvm install --lts
RUN npm install -g express-generator-typescript
Note:
I want nvm to dynamically install the latest LTS version of node.js.
If I typed the same commands in a centos container, I can install the NPM package.
How do I solve this problem?
Error: Cannot find module 'semver' when install vue-js
OS: Windows 7
node version: v6.17
i uninstalled v6.17 and install 8.3 but not worked..how can i solve?
Try this:
npm install --save -g semver
I tried to fix the problem deleting files and reinstalling again. this works fine for me.
First, remove old staff
sudo rm -rf /usr/local/bin/npm /usr/local/share/man/man1/node* ~/.npm
sudo rm -rf /usr/local/lib/node*
sudo rm -rf /usr/local/bin/node*
sudo rm -rf /usr/local/include/node*
sudo apt-get purge nodejs npm
sudo apt autoremove
and then install again with the command:
sudo apt install nodejs
When attempting to run docker build -t app . --memory 3G --memory-swap 4G I run into
Step 8/11 : RUN npm install
---> Running in 5283e1139345
npm WARN deprecated browserslist#2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated fs-promise#2.0.3: Use mz or fs-extra^3.0 with Promise Support
npm WARN deprecated tar.gz#1.0.7: ⚠️ WARNING ⚠️ tar.gz module has been deprecated and your application is vulnerable. Please use tar module instead: https://npmjs.com/tar
npm ERR! write after end
Does anyone know what causes this error? Why is npm not installing? I'm using aws in conjunction with Docker.
Dockerfile is shown below
FROM ubuntu:18.04
WORKDIR /app
COPY . .
# If you have native dependencies, you'll need extra tools
# RUN apk add --no-cache make gcc g++ python
RUN apt-get update \
&& apt-get install -y --no-install-recommends apt-utils -y \
&& apt-get install curl -y \
&& apt-get install git-core -y \
&& curl -sL https://deb.nodesource.com/setup_8.x \
&& apt-get install -y nodejs npm \
&& curl https://cmake.org/files/v3.11/cmake-3.11.3-Linux-x86_64.sh -o /tmp/curl-install.sh \
&& chmod u+x /tmp/curl-install.sh \
&& mkdir /usr/bin/cmake \
&& /tmp/curl-install.sh --skip-license --prefix=/usr/bin/cmake \
&& rm /tmp/curl-install.sh \
&& apt-get install libpq-dev -y \
&& apt-get install libboost-all-dev -y \
&& apt-get install postgresql-server-dev-all -y
ENV PATH="/usr/bin/cmake/bin:${PATH}"
RUN npm install -g npm#5
RUN ./move-cpp-files.sh
RUN npm install
RUN npm run compile
EXPOSE 3000
CMD ["npm", "start"]
You're potentially installing a version of NPM that had this problem:
RUN npm install -g npm#5
Try without that line or is there a specific reason for it?
I'm trying to sudo for a node install:
sudo npm install -g grunt
sudo npm install -g grunt-cli
sudo npm install -g bower
The commands error stating to run as an administrative user. How do I do that in the Dockerfile?
RUN npm install -g grunt
#RUN ln -s /home/dev/spikes/node-esjs-master/node_modules/grunt /usr/bin/grunt
RUN npm install -g grunt-cli
#RUN ln -s /home/dev/spikes/node-esjs-master/node_modules/grunt-cli /usr/bin/grunt-cli
RUN npm install -g bower
#RUN ln -s /home/dev/spikes/node-esjs-master/node_modules/bower /usr/bin/bower
I don't actually try to sudo in the docker commands...I have after connecting to the container but when prompted for the password I don't know it. I tried to create a sym link but couldn't get that to work. My apologies if this is basic in nature - new environments for me :-).
Thanks!
You don't need to use sudo because all commands in the dockerfile are executed as root. A sample Dockerfile to install those software (Ubuntu Thrusty as base):
FROM ubuntu:14.04
RUN apt-get update
RUN apt-get install -y nodejs npm
RUN npm install -g grunt
RUN npm install -g grunt-cli
RUN npm install -g bower
The same applies for the run command:
$ sudo docker run my_awesome_image whoami
root