Lost in Nodester Installation - linux

I am trying to install my own version of Nodester. I have tried on Ubuntu 12.04 LTS and now with CentOS. I am not the most skilled Linux user (~2 months use) so I am at a loss at this point.
The instructions are located at https://github.com/nodester/nodester/wiki/Install-nodester#wiki-a. They ask you to "export paths (to make npm work)" with the lines necessary to accomplish this.
cd ~
echo -e "root = ~/.node_libraries\nmanroot = ~/local/share/man\nbinroot = ~/bin" > ~/.npmrc
echo -e "export PATH=3d9c7cfd35d3628e0aa233dec9ce9a44d2231afcquot;\${PATH}:~/bin3d9c7cfd35d3628e0aa233dec9ce9a44d2231afcquot;;" >> ~/.bashrc
source ~/.bashrc
I can accomplish all of this until I get to the source ~/.bashrc line. When I run that, I get the following:
[root#MYSERVER ~]# source ~/.bashrc
-bash: /root/.bashrc: line 13: syntax error near unexpected token ';;'
-bash: /root/.bashrc: line 13: 'export PATH=3d9c7cfd35d3628e0aa233dec9ce9a44d2231afcquot;${PATH}:~/bin3d9c7cfd35d3628e0aa233dec9ce9a44d2231afcquot;;
I have tried changing the quot; to " and that didn't help. I tried changing quot; to colons and that didn't help. I also removed that and it didn't help (I am sure many of you at this point are probably wondering why I would even try those things). Does anyone have any insight as to what I need to do to get this to run properly?

This looks more like a documentation error than your failing to understand anything. Created issue 409 for it on Github.
In the meantime, going back through the wiki page's history, I found the following which may help. It certainly looks more reasonable though I won't be able to confirm for some time.
Export paths (to make npm work):
> cd ~
> echo -e "root = ~/.node_libraries\nmanroot = ~/local/share/man\nbinroot = ~/bin" > ~/.npmrc
> echo -e "export PATH=\"\${PATH}:~/bin\";" >> ~/.bashrc
> source ~/.bashrc
From commit d71e66b4c96f04c13467ede5f6469d6d4dd17059

Related

bash: /home/x/.bash_profile: Permission denied. How to fix this issue?

I am trying to open the bash_profile file but it gives the following result
~/.bash_profile
bash: /home/x/.bash_profile: Permission denied
After searching I found this solution on the internet
source ~/.bash_profile
But this command gives the following output
The program 'the' is currently not installed. You can install it by typing:
sudo apt install the
when I typed it gives this result
sudo apt install
[sudo] password for x:
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove, and 0 not upgraded.
x#ubuntu:~$ source ~/.bash_profile
The program 'the' is currently not installed. You can install it by typing:
sudo apt install the
please help me how to fix it.
Thank you All.
For viewing the bash_profile:
cat ~/.bash_profile
For editing:
vi ~/.bash_profile
If you get a permission denied, use sudo before cat or vi commands.
Hello
And for only creating your own without editing it...
set -x && $(type -p touch) ${HOME}"/.bash_profile"; set +x
... if already exists then only the modification time is changing.
I wrote the simple command cryptic because set -x shows what going on and set +x exits the debug mode.
After the clarifications, let me tell you what is happening.
The ~/.bash_profile file is a configuration file for configuring user environments. The users can modify the default settings and add any extra configurations on it. In your case, the file is empty and it is throwing an error because inside the file you have the word "the".
You Linux Server is trying to run the command "the", so the reason for the error you are getting is that you have no execution privileges over it. I've never ever heard of a program called "the", but giving your error perhaps the program is there. If the program did not exist, you would have gotten "No such file or directory".
Replace the content of the .bash_profile with the minimum content you need for this kind of file:
$ cat ~/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
export PATH=.:$PATH:$HOME/.local/bin:$HOME/bin

(oh-my-)zsh behaviour: `$ command_name` at home directory results in `cd command_name` effect

I'm currently using zsh with oh-my-zsh, and I've run into an annoying shell behaviour.
I must have done a subtle yet breaking change in the $PATH export while editing my .zshrc, because the following thing happens:
At the shell prompt while in ~/, issuing, for example, the flutter command...
$ flutter
...results in:
$ ~/flutter/
(as if calling $ flutter had been interpreted as $ cd flutter)
However, issuing $ flutter in any other directory, including $ ~/flutter results in the correct execution of the flutter command. Same thing for go and others.
Line 2 on my .zshrc exports $PATH in the following fashion:
export PATH=$HOME/bin:$HOME/.emacs.d:$HOME/flutter/bin/cache/dart-sdk:$HOME/flutter/bin/cache/dart-sdk/bin:$HOME/.pub-cache/bin:$HOME/.composer/vendor/bin:$HOME/.cargo/env:$HOME/.platformio/penv/bin:$HOME/flutter/bin:$PATH
I've been comparing .zshrc versions with other backups, and I may be missing something, but no differences were found.
What seems off, in your opinion?
If you've encountered this annoyance before, how did you correct it?
Explanation
It'a feature called AUTO_CD.
AUTO_CD (-J)
If a command is issued that can’t be executed as a normal command, and the command is the name of a directory, perform the cd command to that directory.
http://zsh.sourceforge.net/Doc/Release/Options.html#Changing-Directories
AUTO_CD is enabled by oh-my-zsh in file oh-my-zsh/lib/theme-and-appearance.zsh.
...
setopt auto_cd
setopt multios
setopt prompt_subst
[[ -n "$WINDOW" ]] && SCREEN_NO="%B$WINDOW%b " || SCREEN_NO=""
...
Solution
Append the following command in ~/.zshrc after oh-my-zsh is loaded to disable this feature.
unsetopt AUTO_CD

centos7 “export: command not found

I have followed a tutorial to install JDK 8 on my computer Centos7 OS, but in the last part I tried to set environment varibles.
In the last part of the tutorial I typed:
echo “export JAVA_HOME=/opt/jdk1.8.0_101” > /etc/profile.d/jre.sh
echo “export JRE_HOME=/opt/jdk1.8.0_101/jre” >> /etc/profile.d/jre.sh
echo “export PATH=$PATH:/opt/jdk1.8.0_101/bin:/opt/jdk1.8.0_101/jre/bin” >> /etc/profile.d/jre.sh
and then I am seeing this when I open the terminal:
bash: $'\342\200\234export':order not found
bash: $'\342\200\234export': order not found
bash: $'\342\200\234export': order not found
[evconsul8#localhost ~]$
Path:
[evconsul8#localhost ~]$ echo $PATH
/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/evconsul8/.local/bin:/home/evconsul8/bin
After that I Trying to search the cause open
~/.bash_profile
[root#localhost evconsul8]# gedit ~/.bash_profile
Result:
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export JAVA_HOME=/opt/jdk1.8.0_101
export JRE_HOME=/opt/jdk1.8.0_101/jre
export PATH=$PATH:/opt/jdk1.8.0_101/bin:/opt/jdk1.8.0_101/jre/bin
export PATH
Note: In one of my attemps after the error I added manually the lines corresponding to JAVA_HOME, JRE_HOME and PATH=$PATH in the file above. It was ok??
The principal problem I guess it is causing troubles to other apps in my machine.
You should use regular double quotes (") to enclose a string and not the fancy ones (“) you are using.

bash: __vte_prompt_command: command not found

bash: __vte_prompt_command: command not found
Whenever I open a terminal, I am greeted with this line. Also, this is printed each time I enter a command in the terminal.
I am a linux-noob, and would be happy to read up, if someone can point me to some resource, or hint at a possible solution. I tried google-ing, but was unable to turn up with any useful results.
I did not do anything specific just before this started popping up.
Thanks in advance :)
Additional Info:
The terminal I used is the default gnome-terminal
Fedora 20
It sounds like a program named VTE has set your bash environment variable PROMPT_COMMAND to invoke a function called __vte_prompt_command.
The PROMPT_COMMAND environment variable defines a command that is executed before every new prompt is displayed to the screen. It can be very annoying when this command produces unexpected output.
You can temporarily get rid of the annoying messages by entering this command in the terminal:
__vte_prompt_command() { true; }
This creates a dummy function that does nothing - you can confirm by looking at the output of this command:
type __vte_prompt_command
After applying the hack to my system I see this:
__vte_prompt_command is a function
__vte_prompt_command ()
{
true
}
However, this is an indication that VTE may not be installed properly and/or may be broken. You might want to try to reinstall VTE, if possible. I would not recommend putting this permanently into your ~/.bashrc file.
I am running Ubuntu 18.04 with the default gnome-terminal and ran into the same problem but wanted a definitive solution.
After trying the solutions suggested previously, I still had the message:
__vte_prompt_command: command not found
comming up after starting a new terminal and after each command terminated.
I searched for a file in for instance .bashrc, .profile that would be doing a source /etc/profile.d/vte-2.91.sh with no luck.
Than I remembered that a long time ago I added the following line in my ~/.bashrc:
export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r"
in order to append command line histories to all opened terminals. I figured out that commenting it solved the problem.
#export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r"
than
$ source ~/.bashrc
Thought I would share this for anyone having the same problem.
You can disable the corresponding code by editing your ~/.bashrc by using sudo gedit ~/.bashrc, searching for the string "vte" with STRG+F and outcommenting the line with a #.
On my system, the line looked like this, I guess an old installation of Ubuntu Budgie put it there:
if [ $TILIX_ID ] || [ $VTE_VERSION ] ; then source /etc/profile.d/vte.sh; fi # Ubuntu Budgie END
And if it looks like this, the line in your terminal will not appear anymore:
#if [ $TILIX_ID ] || [ $VTE_VERSION ] ; then source /etc/profile.d/vte.sh; fi # Ubuntu Budgie END
For CentOS7 (64 bit):
Try installing using yum command.
sudo yum update -y
sudo yum install -y terminator
sudo yum install -y epel-release
sudo yum install -y terminator #again
Resart the command prompt terminal, This worked for me (:
Reference: http://bytefreaks.net/gnulinux/install-terminator-in-centos-7-64bit
set +v
I think you may somehow made: set -v (Prints shell input lines as they are read.)
so set i

nodejs active on boot with nvm $HOME/nvm/nvm.sh

I installed node with nvm it works fine, but every new session i need to do source $HOME/nvm/nvm.sh to get node active
How can I do to be active on boot so there is no need to type source $HOME/nvm/nvm.sh in every sssh session
I try to add this command source $HOME/nvm/nvm.sh to /etc/rc.local but I get the following error
> /etc/init.d/node_start.sh: 13: root/nvm/nvm.sh: Bad substitution
> /etc/init.d/node_start.sh: 78: root/nvm/nvm.sh: [[: not found
> /etc/init.d/node_start.sh: 78: root/nvm/nvm.sh: [[: not found
> /etc/init.d/node_start.sh: 129: root/nvm/nvm.sh: [[: not found
> /etc/rc.local: 14: /etc/rc.local: source: not found
But if i done that command on shell works normally
Any help is welcome
Regards
You should add the line below to the end of ~/.bashrc file:
[[ -s /home/$USER/.nvm/nvm.sh ]] && . /home/$USER/.nvm/nvm.sh
The init script is running as root, not your user. If you want to source your own nvm.sh, you shouldn't use $HOME, but rather just use the absolute path like /home/vitor/nvm/nvm.sh. Also the init script is probably running under dash so you should not use the [[ construct. Just use [ instead as described in this dash as /bin/sh article
So I went and read the nvm.sh source code from https://github.com/creationix/nvm/blob/master/nvm.sh
I don't think that is compatible with dash. So I suggest you leave nvm.sh elsewhere in the filesystem and in your init script just do
exec /bin/bash /root/nvm/nvm.sh
Starting node_start.sh with #!/bin/bash may also be sufficient.
You may also want to subscribe to issue 168 on github for nvm where others hit this error.
I expect your init script starts with #!/bin/sh when it needs to start with #!/bin/bash. Of course, there may be many good reasons not to write init scripts in Bash...

Resources