Environment variables will remain

Asked

Viewed 472 times

1

I’m following this tutorial, on Linux, but every time I restart I have to set all the variables again

What I have to do to make the settings remain and globally?

I’m using Linux Mint Cinamon (Sylvia) 64 bits

[EDIT1]

For example:

I do it in the terminal, then when I run inside the Phpstorm terminal, the command tsc -w for example he said that: /usr/bin/env: “node”: Arquivo ou diretório não encontrado, ai only Seto the variables that works. But every time I want to open a new terminal window I have to set the environment variables again

Actually if I use the command ~/.profile gives that message bash: /home/carlos/.profile: Permissão negada both in root and in my user

  • Please explain better, the filing cabinet ~/.profile lose the data, that’s it?

  • For example, I do this in the terminal, then when I run inside the Phpstorm terminal, the command tsc -w for example he said that: /usr/bin/env: "Node": File or directory not found, ai so Seto the variables that works. But every time I want to open a new terminal window I have to set the environment variables again

  • In fact the command ~/.profile gives that message bash: /home/carlos/.profile: Permissão negada

  • @adventistaam Already tried to move Node to /usr/bin ?

  • @adventist ~/.profile is not a command, is a file, you have to open it by a word processor, like Vim for example, and add the vars

  • Your last suggestion was right @Guilhermenascimento. You can add the answer please

Show 1 more comment

1 answer

3


The ~/.profile quoted in the video is not a command and so when type occurs the message:

Permission denied

It is a configuration document, meaning you have to edit it with a word processor, such as Vim for example, then when opening in your text editor at the last line (if you already have something in it) add this (do not delete anything):

export NODEJS_HOME=/usr/local/lib/nodejs/node-v8.9.4/bin
export PATH=$NODEJS_HOME:$PATH

Then save the document, while saving it you may need to refresh (or logoff), to make the refresh type exactly this (including the point at the beginning before the file path):

. ~/.profile

In the terminal it will look like something:

$. ~/.profile

Ready should work, so to test if it had effect run on the terminal this:

node -v

Browser other questions tagged

You are not signed in. Login or sign up in order to post.