Escolar Documentos
Profissional Documentos
Cultura Documentos
Como
1 of 12 19/05/2023, 11:19
Instale Node.js no Red Hat Enterprise Linux | Red Hat De... https://developers.redhat.com/hello-world/nodejs#introdu...
Introdução e Pré-requisitos
Neste tutorial, você configurará seu sistema para instalar o software da Red Hat
Software Collections (RHSCL), que fornece as mais recentes tecnologias de
desenvolvimento para o Red Hat Enterprise Linux. Então, você instalará o
Node.js v8 e executará uma aplicação simples “Olá, Mundo”. Todo o tutorial deve
levar menos de 10 minutos para ser concluído.
Nesta etapa, você configurará seu sistema para obter software, incluindo as
linguagens dinâmicas mais recentes, do repositório de software RHSCL. As
instruções são fornecidas para a linha de comando (CLI) e interface gráfica do
usuário (GUI).
2 of 12 19/05/2023, 11:19
Instale Node.js no Red Hat Enterprise Linux | Red Hat De... https://developers.redhat.com/hello-world/nodejs#introdu...
Se você não vir nenhum repositório RHSCL na lista, sua assinatura pode não
incluí-lo. Consulte Solução de problemas e FAQ para mais informações.
$ su - Visão geral
subscription-manager repos --list | egrep rhscl
Se você não vir nenhum repositório RHSCL na lista, sua assinatura pode não
incluí-lo. Consulte Solução de problemas e FAQ para mais informações.
3 of 12 19/05/2023, 11:19
Instale Node.js no Red Hat Enterprise Linux | Red Hat De... https://developers.redhat.com/hello-world/nodejs#introdu...
Sob seu ID de usuário normal, inicie uma janela do Terminal. Em primeiro lugar,
usar scl enable para adicionar Node.js v4 ao seu ambiente, em seguida,
execute Node.js para verificar a versão.
Copiar o snippet
$ node ./hello.js
Olá, Red Hat Developer Program World de Node v8.6.0
Se você receber o erro: o comando nó não foi encontrado, você precisa executar
scl enable rh-nodejs8 bash Primeiro.
4 of 12 19/05/2023, 11:19
Instale Node.js no Red Hat Enterprise Linux | Red Hat De... https://developers.redhat.com/hello-world/nodejs#introdu...
Copiar o snippet
$ node ./hello-http.js
Agora use curl, ou um navegador como o Firefox, para se conectar ao servidor
da Web Node.js http://localhost:8000/ :
$ curl http://localhost:8000/
Olá, Red Hat Developer Program World da v8.6.0!
5 of 12 19/05/2023, 11:19
Instale Node.js no Red Hat Enterprise Linux | Red Hat De... https://developers.redhat.com/hello-world/nodejs#introdu...
Quando você entrega um aplicativo que usa pacotes RHSCL, uma prática
recomendada é ter seu script de inicialização. scl enable passo para a sua
aplicação. Você não deve pedir aos seus usuários que alterem o ambiente, pois
isso provavelmente criará conflitos com outros aplicativos.
Agora que você tem Node.js instalado, use os tutoriais de nodeschool.io para
aprender Node.js e JavaScript. Você precisa ter já executado scl enable
rh-nodejs4 bash ou ter adicionado Node.js permanentemente ao seu
ambiente de desenvolvimento.
$ javascripting
Execute o tutorial Node.js:
$ Aprenda nadar
Ver documentação no site Nodejs.org
http://nodejs.org/documentação/
6 of 12 19/05/2023, 11:19
Instale Node.js no Red Hat Enterprise Linux | Red Hat De... https://developers.redhat.com/hello-world/nodejs#introdu...
ou para o RHEL 6:
7 of 12 19/05/2023, 11:19
Instale Node.js no Red Hat Enterprise Linux | Red Hat De... https://developers.redhat.com/hello-world/nodejs#introdu...
RHSCL:
$ su - Visão geral
subscription-manager repos --list | egrep rhscl
5. Posso criar meus próprios pacotes que usam os mecanismos scl para
gerenciar várias versões?
Some RHSCL collections require packages that are in the optional RPMs
repository, which is not enabled by default. See Step1 above for how to
8 of 12 19/05/2023, 11:19
Instale Node.js no Red Hat Enterprise Linux | Red Hat De... https://developers.redhat.com/hello-world/nodejs#introdu...
repository, which is not enabled by default. See Step1 above for how to
enable both the optional RPMs and RHSCL repositories.
scl --list will show the list of collections that have been installed,
whether they are enabled or not.
$ scl --list
rh-nodejs8
I have the RHSCL repository enabled, but I can’t find the Node.js
version listed in this tutorial.
Note: some older collections do not use the rh- prefix. To find them
omit the rh- prefix or replace it with an escaped wild card \* .
10. I’ve installed rh-nodejs8 from RHSCL, but node is not in my path.
RHSCL does not alter the system path. You need to use scl
enable to change the environment for your session:
11. When I try to run node , I get an error about a missing shared library.
This is due to not having run scl enable first. When scl
enable runs, in addition to setting up the command search PATH, it also
sets up the search path for shared libraries, LD_LIBRARY_PATH.
9 of 12 19/05/2023, 11:19
Instale Node.js no Red Hat Enterprise Linux | Red Hat De... https://developers.redhat.com/hello-world/nodejs#introdu...
With the current version of the scl-utils package it is now possible to use
Python, PHP, Node.JS and Perl interpreters from a “#!” line, using the
following syntax (or equivalent):
Recent Articles
How to use the new OpenShift quick starts to deploy JBoss EAP
Comments
✕ ?
10 of 12 19/05/2023, 11:19
Instale Node.js no Red Hat Enterprise Linux | Red Hat De... https://developers.redhat.com/hello-world/nodejs#introdu...
Resource library
We serve the builders. The problem solvers who create careers with code.
Sign me up
Jobs
Events
Locations
11 of 12 19/05/2023, 11:19
Instale Node.js no Red Hat Enterprise Linux | Red Hat De... https://developers.redhat.com/hello-world/nodejs#introdu...
Privacy statement
Terms of use
Digital accessibility
Preferências de cookies
12 of 12 19/05/2023, 11:19