Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 176 Vote(s) - 3.7 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Installing NPM on AWS EC2

#1

Working on Ec2 on AWS.

I have installed Node.js and it works fine.

But the problem arises when trying to install npm.

I am using the following command to install it:

sudo curl

[To see links please register here]

| sh

But the install seems to freeze...
I get "fetching:

[To see links please register here]

; at the prompt and it stays on like this.

Have any idea what is going on here?
Reply

#2
I found his tutorial that has been very usefull to me: The last chapter explains how to install node and npm compiling it.

[To see links please register here]

Reply

#3
sudo yum install nodejs npm --enablerepo=epel
Reply

#4
Edit as my answer wasn't pertinent anymore:

Try:

curl --silent --location

[To see links please register here]

| bash -

yum -y install nodejs

[To see links please register here]

Reply

#5
Firstly

sudo yum install make

You can run this to get zip of desired version of node

wget

[To see links please register here]


Then you can unzip it like this

tar -xvf node-v8.10.0.tar.gz

then go in to the extracted directory and install node like this

./configure && make && sudo make install


Reply

#6
Get the `http://npmjs.org/install.sh` file on your system first and then execute it directly instead of piping with curl.

- Use `chmod +x install.sh` to make it executable
- Then run `./install.sh`
Reply

#7
This guide worked perfectly:

[To see links please register here]


1. Make sure you have make

`# sudo yum install -y gcc-c++ make`

2. Install source

`# curl -sL

[To see links please register here]

| sudo -E bash -`

3. Install node

`# sudo yum install -y nodejs`

Note - you'll have to run `sudo npm install` to get the installs to work.
Reply

#8
I did it manually. Why mess with installers that break or don't put things where I want them? Such were the problems encountered while installing *node.js" on Amazon Web Services, that a manual install was the easy way to get the result I wanted.

I want a GLOBAL install of `node` and `npm` on AWS. By that I mean install should be put in a place like `/usr/bin`, so that all users have access. Surprisingly, AWS apparently doesn't give support to that idea. AWS encourages using `nvm`, *node version manager*, but that seems to always install in a user directory, and not a system level directory. After being frustrated when the "rpm" solutions (mentioned elsewhere) failed, I finally decided to just do the installation manually.

In a browser, go to nodejs.org download page:

[To see links please register here]


Find a link that says:

All download options

Click through that; it goes to an index page with a URL like:

[To see links please register here]


There I looked for the name that had "linux" and "x86" in the name.
I wrote this down, or select-and-copied, to get the correct spelling.
In my case it was:

node-v14.16.1-linux-x64.tar.gz

Putting the two parts together, I got the following URL:

[To see links please register here]


So that's what is to be downloaded using `curl`.

I have a "temp" directory conveniently located in my home dir.

cd ~/temp

The download was accomplished with "curl". Note that the `-o` option was used to give the *output* file the name of my choosing. Of course, I chose to give it the same name as the web site file.

curl -o node-v14.16.1-linux-x64.tar.gz

[To see links please register here]


Untar the downloaded file.

tar xf node-v14.16.1-linux-x64.tar.gz

Conveniently, it creates its own directory. Go there.

cd node-v14.16.1-linux-x64 || exit 1;

Observe that the delivery consists of a relatively small number of files and directories (since *node_modules* is dealt with as a unit).

In my case, I had an old and bad implementation still installed, so the following commands were used to move aside any junk that might happen to be in the way. Some commands errored out because the old junk didn't exist. That's ok, error while moving to `-OLD` just means there is nothing to move; which is good.

Note: I put all these `mv` (move) commands into a script file, made it executable, and ran it as `sudo`. The alternative is to run each line individually as `sudo`.

mv /usr/bin/node /usr/bin/node-OLD
mv /usr/bin/npm /usr/bin/npm-OLD
mv /usr/bin/npx /usr/bin/npx-OLD
mv /usr/include/node /usr/include/node-OLD
mv /usr/lib/node_modules /usr/lib/node_modules-OLD
mv /usr/share/doc/node /usr/share/doc/node-OLD
mv /usr/share/man/man1/node.1 /usr/share/man/man1/node.1-OLD
mv /usr/share/systemtap/tapset/node.stp /usr/share/systemtap/tapset/node.stp-OLD

An here is the actual install. Remember, this is occurring in the untarred directory, in my case *node-v14.16.1-linux-x64*.

mv bin/node /usr/bin
mv bin/npm /usr/bin
mv bin/npx /usr/bin
mv include/node /usr/include
mv lib/node_modules /usr/lib
mv share/doc/node /usr/share/doc
mv share/man/man1/node.1 /usr/share/man/man1
mv share/systemtap/tapset/node.stp /usr/share/systemtap/tapset/

That's it, all finished.
Reply

#9
Simplest way to install npm/nodejs on Amazon Linux 2 ec2 isntance:

1. First install epel repo using amazon-linux-extras command as below:



> `sudo amazon-linux-extras install epel`

2. Now install npm and nodejs as below:



> `sudo yum install nodejs npm`

3. you can verify the version of node and npm as below:



> `node -v`
>
> `npm -v`

PS. I've tested this on Amazon Linux 2 AMI (HVM) ec2 instance.
Reply

#10
This works for me:


sudo apt install npm
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through