npm globally installed package. command not found on zsh - zsh

I'm trying to install the npm package #wicked/cli using the command
npm install #wicked/cli -g
The output I'm getting indicates that the package has been updated, which means it was already installed.
However, when I tried running the command wicked-cli, I get the following error
zsh: command not found: wicked-cli
Am I missing something ? is there a path I need to add to the $Path? I've just updated my mac os a couple of days ago and not really familiar with zsh

I believe the command is just called wicked and not wicked-cli
Try run wicked --help
Source: https://www.npmjs.com/package/wicked-cli

Related

Python packages required to run RStudio Quarto files in VS Code

I have been trying to run RStudio Quarto script in a fresh Ubuntu 20.04 installation but got into some trouble. Some Python packages that are required to run the simple hello.qmd were not there. I was getting these errors:
MoudleNotFoundError: No module named 'nbclient'
and a second error:
ModuleNotFoundError: No module named 'matplotlib_inline'
The first error was due to I had install the nbclient package. My default Python installation is python2.7. Quarto will not run well with Python 2.7; we should try with 3.7+. If your Linux doesn't come with it by default, this can easily be addressed by installing another Python version and configuring multiple Python versions with the help of the command:
sudo update-alternatives --config python
If no Python version shows up, then it means you have first to configure all your installed Python versions. This is very well explained at https://www.rosehosting.com/blog/how-to-install-and-switch-python-versions-on-ubuntu-20-04/
Once you have configured all your Python versions, every time that you run
sudo update-alternatives --config python, you will be prompted to enter the Python version you want as default. If you have a fresh Ubuntu 20.04, most likely that you have two: Python 2.7 and Python 3.8. Select 3.8 and you will fine. Quarto won't work with Python 2.7.
After you have python3 running and switched into, install nbclient with:
pip install nbclient.
The first error will now pass, but most likely you will get now
ModuleNotFoundError: No module named 'matplotlib_inline'. This is because you also need to install the package matplotlib-inline. This is not documented in the installation instructions of Quarto. But easy to fix. Run:
pip install matplotlib-inline
Now, go back to your VS Code, open the command palette and run Quarto: Render, or just type from the terminal:
quarto preview hello.qmd --no-browser --no-watch-inputs
You are done!

Installing Sqlite3 on Ubuntu 14.04 for Python3.6

I have a virtual environment set up with python 3.6. I'm trying to install sqlite3 (I built python from source) and am having trouble doing so. (I need sqlite3 for tensorboard)
After some digging I found an approach:
sudo apt-get install libsqlite3-dev
Now in the downloaded python source rebuild and install python with the following command:
./configure --enable-loadable-sqlite-extensions && make && sudo make install
The issue is I cannot run the first command. Running the first command gives me the error "download failed Oracle JDK 6 is NOT installed." Therefore I downloaded the libsqlite3-dev file.
My question is, where should this be placed before I can run step 2.
I've looked around for a solution for a few hours now ans seem to be at a loss. Any help would be really appreciated with either solving this approach or proposing another approach.
Use Anaconda
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
conda create -n envsq python=3.7
source activate envsq
python
And you can import sqlite3 with no issues.

Sed directory not found when running R with -e flag

When I try to run the following command:
R --slave --no-save --no-restore -e "print('foo')"
I get:
/usr/local/bin/R: line 193: /usr/local/Library/ENV/4.3/sed: No such file or directory
ERROR: option '-e' requires a non-empty argument
Apparently brew recently moved the ENV folder to a new path (see here). I know I can easily symlink the new sed dir to fix the issue but I wanted to know if there is a better workaround / fix (and eventually if this will be fixed in the R source code).
This happens because brew has changed it's paths in this commit so if you've run brew update in the last 4 days, this is what has caused the breakage.
Credit goes to blindjesse for this answer, which is to brew reinstall -s r.
I ran into some other issues when I tried this though. I didn't have X11 installed and I had a conflict with the tcl-tk which meant that it caused some other failures when it was compiling so:
I installed XQuartz from https://www.xquartz.org
Symlinked it to my homebrew folder ln -s /opt/X11/include/X11 /usr/local/include/X11 (note that your homebrew directory may be different)
brew install homebrew/dupes/tcl-tk
brew link --overwrite --force tcl-tk; brew unlink tcl-tk
brew reinstall -s r
And then it worked for me. I think once the r bottle is upgraded this issue should disappear but for the moment this is what I had to do.
Upgraded to Sierra, tried the commands above and also the directions here: https://github.com/Homebrew/homebrew-science/issues/4338. After I also reinstalled the R kernel following the instructions here: https://github.com/IRkernel/IRkernel, things started working again. Oy vey.
To reinstall the R kernel, start R in the terminal and enter the following:
install.packages(c('repr', 'IRdisplay', 'crayon', 'pbdZMQ', 'devtools'))
devtools::install_github('IRkernel/IRkernel')
IRkernel::installspec() # to register the kernel in the current R installation
Rather than having sed's path hardcoded, a simple workaround is to edit the R script and to change line 193 with
SED=$(which sed)

grunt not installing/available globally

I'm trying to install grunt globally using the following command from the command line:
npm install -g grunt
The installation command seems to succeed with no errors written to the console. However, when I enter grunt at the command line after install I get the following error:
'grunt' is not recognized as an internal or external command, operable program or batch file
It looks like the install command installs grunt into the following directory by default:
c:\users\my_login_id\appdata\roaming\npm\node_modules\grunt
Not sure if the user-specific install directory might have anything to do with the issue? Any idea what might be causing the problem or how to debug?
You don't need to install grunt globally. I suggest you make grunt a dependency of your project. That way anyone can execute a npm install and get grunt. If you want to use the terminal commands, then you must install the command line interface package
Use:
npm install -g grunt-cli

Rscript on ubuntu

Where can I install Rscript from? I need to run an R script from a php file using exec. However I need to install Rscript first.
The main package for R is called r-base. For the scripting and command-line front-end see littler (or r-cran-littler in xenial (16.04LTS) and beyond):
sudo apt-get install littler
Search the ubuntu repositories. Have you checked the littler package?
The answers posted so far are generally useful, but they don't directly answer the question. I recently had the same question and discovered there is no rscript binary for Ubuntu. The r binary itself is used to execute scripts in batch mode as opposed to the separate rscript binary that I was using in OS X.
It appears you may be able to get an rscript binary from other sources (see http://craig-russell.co.uk/2012/05/08/install-r-on-ubuntu.html#.UwKWzkJdW2Q for example), but I'm not sure why you would need that when simple running "r script.r" from the command line works just fine.
I tried running Rscript in a fresh ubuntu installation (16.04.2 LTS) and got:
The program 'Rscript' is currently not installed. You can install it by typing:
sudo apt install r-base-core
so, naturally, i ran sudo apt install r-base-core.
installation took a couple of minutes.
Later, i needed to install an R package, and realized i needed an R shell for that. running r returned:
The program 'r' is currently not installed. You can install it by typing:
sudo apt install r-cran-littler
Again, i followed, this time it was quite faster.
I don't know if these are the correct steps to take (or why they would be wrong), but it's what the system led me to do.

Resources