Terminal version installation not success

Hi there,

I am new to Linux and Joplin, I have installed joplin desktop and it works, but when installing the terminal version, it has following errors, I am on Ubuntu18.04, using this command:
NPM_CONFIG_PREFIX=~/.joplin-bin npm install -g joplin

Errors:
npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()
npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno -2
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t https://github.com/laurent22/node-emoji.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

Thanks

Welcome to the community and welcome to the wonderful world of Linux, where a vast majority of what will define your enjoyment will depend heavily on how willing you are to scour forums and the internet for answers to many crazy problems you’ll run into. It’s part of what i personally love about the platform.

After a quick search, the error you’re running into is most likely a cache problem.

  1. Your npm cache could have some corrupted files. I would run
    npm cache verify
    to check if there any issues with it. If there are, it should fix the issues by itself. I would also run
    sudo npm cache verify
    to check if your global installs are having issues also. (Made some minor edits here since my original instructions were definitely outdated).

  2. Go ahead and run
    NPM_CONFIG_PREFIX=~/.joplin-bin npm install -g joplin
    to install joplin locally. (Made a correction here from original posting on my phone after discovering I was wrong when I got to my PC).

  3. Then, add
    export PATH="$PATH:$HOME/.joplin-bin/bin"
    to the bottom of both your $HOME/.bash_profile and $HOME/.profile files. The reason I’m using $HOME instead of ~ for your home directory is because some distros and configurations won’t use the latter at all and will throw some possible errors.

  4. Restart.

  5. Open a terminal and run
    echo $PATH
    It should show a bunch of directories with bin in them and then the one I had you add above. These are where your system will look for new programs so you can run them from your terminal or program launcher without having to type each path out.

If you’re still having issues, feel free to respond.

2 Likes

I had the same issue, ensure you have git installed and try again.

On Ubuntu it’s probably:

sudo apt install git

HTH

2 Likes

That definitely might be the case, although, it would definitely be better to use

sudo apt-get install git

for simplicity’s sake, since that’s the standard way of handling it in most support posts and whatnot.

1 Like

Thanks Bedwardly-down and Johano, I am testing on a VM almost clean installed, so I choose the simple way to install git and after that it works.

If you could select @johano 's answer as the Solution, that would definitely help, @DoubleK66. Thanks

1 Like

Yeah, after install git it works.

Hey ,
I am having the same issue as DoubleK66 and in specific am getting a git permission denied reply.
npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/laurent22/uslug.git
npm ERR! git@github.com: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-03-09T08_38_37_234Z-debug-0.log

I did a cache verify of npm and it was a success and i also managed to re-install git to the latest version.
I'll appreciate some insights .Thanks!

1 Like

I have the exact same issue and I am not able to figure out where I went wrong.

npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/laurent22/uslug.git
npm ERR! git@github.com: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR! 
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.