Para instalar o Node.js e o npm
, use o script setup
(por exemplo, Nod.js V8):
sudo apt-get install -y build-essential
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
Um nodesource.list
será criado sob seu /etc/apt/sources.list.d
com o seguinte conteúdo:
deb https://deb.nodesource.com/node_8.x stretch main
deb-src https://deb.nodesource.com/node_8.x stretch main
Em seguida, instale electron
e brower
:
npm install -g electron
npm install -g bower
Site oficial: Instalando o Node.js através do gerenciador de pacotes
Atualizar
npm ERR! Error: EACCES: permission denied, access '/usr/lib/node_modules'
You may receive an EACCES error when you try to install a package globally. This indicates that you do not have permission to write to the directories that npm uses to store global packages and commands.
You can fix this problem using one of three options:
- Change the permission to npm's default directory.
- Change npm's default directory to another directory.
- Install Node with a package manager that takes care of this for you.
You should back-up your computer before moving forward.
Uma solução de trabalho no github: o comentário de ander7agar testado no debian Stretch:
sudo npm install -g electron --unsafe-perm=true --allow-root
o mesmo erro ocorrerá ao instalar o brower
, alterar a propriedade de node_modules
:
sudo chown -R masi:masi /usr/lib/node_modules
sudo npm install -g bower