Grunt command has no effect : no output no error - gruntjs

04).
I want to use grunt.
I install grunt following this http://gruntjs.com/getting-started
I also installed nodejs.
But when i type the command grunt -h it has no effect and just a new line for a new command !
I try to remove nodejs it output a error like. grunt is not recognize..
Any idea to debug that ?
Many thanks !

I had a problem with my node installation I did:
sudo apt-get --purge remove node
sudo apt-get --purge remove nodejs
sudo apt-get install nodejs
sudo ln -s /usr/bin/nodejs /usr/bin/node
and it solve my problem!

Related

Permision denied for dotnet

I recently installed dotnet 5.0 on Pop OS but whenever I try to use it it says that I don't have permission.
For example, if I just try to run the command dotnet it gives the the message
cannot snap-exec: cannot exec "/snap/dotnet-sdk/144/snap/command-chain/snapcraft-runner": permission denied
When I run the command as the root user it works perfectly fine.
I don't know if this is because I installed dotnet as a snap package
I had the same issue and unfortunately the dotnet issue page was not working.
To fix this issue I had to install the package with apt instead of snap.
sudo snap remove dotnet-sdk // if needed
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt update
sudo apt install apt-transport-https
sudo apt-get install -y dotnet-sdk-5.0
Remove snap first
sudo snap remove dotnet-sdk
Manually download Dotnet SDK https://dotnet.microsoft.com/en-us/download/dotnet/6.0
When your download completes, open the terminal and run the following commands to extract the SDK to make the commands available at the terminal.
mkdir -p $HOME/dotnet && tar zxf dotnet-sdk-6.0.101-linux-x64.tar.gz -C $HOME/dotnet
export DOTNET_ROOT=$HOME/dotnet
export PATH=$PATH:$HOME/dotnet
one last thing
Edit shell profile to permanently

How to install Swoole in ubuntu

Simply my Question is How to Install Swoole in Ubuntu 14.04 LTS
I have tried
sudo pecl install swoole
am getting handfull of errors, already posted here
Is there any alternate way to install the same...
Swoole Installation alternate ways
1.Install from source
sudo apt-get install php7-dev
git clone https://github.com/swoole/swoole-src.git
cd swoole-src
phpize
./configure
make && make install
2.Example for static compile
git clone -b PHP-7.2 --depth 1 https://github.com/php/php-src.git
cd php-src/
git clone -b master --depth 1 https://github.com/swoole/swoole-src.git ext/swoole
./buildconf --force
./configure --prefix=/usr/local/php7 --disable-all --enable-cli --disable-cgi --disable-fpm --disable-phpdbg --enable-bcmath --enable-hash --enable-json --enable-mbstring --enable-mbregex --enable-mbregex-backtrack --enable-sockets --enable-pdo --with-sodium --with-password-argon2 --with-sqlite3 --with-pdo-sqlite --with-pcre-regex --with-zlib --with-openssl-dir --enable-swoole-static --enable-openssl --with-swoole
time make -j `cat /proc/cpuinfo | grep processor | wc -l`
sudo make install
Some Linux distributions do not include the PHP-XML extension in their PHP package and will need to be enabled before using PECL. You can install using apt-get install php-xml and you may need to install PHPize to compile Swoole, you can install it using apt-get install php7.*-dev or whatever PHP version you are using.
Then try again with sudo pecl install swoole
For those who installed PHP from ondrej/php PPA (quite common way to install PHP in Ubuntu) it's quite easy now:
sudo apt install php-swoole
Or for specific version:
sudo apt install php7.4-swoole
Tip. This is how you usually install ondrej/php PPA:
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
Install swoole for version specific should work for example if you have php 7.3 use
sudo apt install php7.3-swoole
replace the version to your local php env

How to install a specific version of node in a Ubuntu environment

When I docker run -it wordpress:php7.0-apache I could execute all of those following command
FROM wordpress:php7.0-apache
RUN apt-get update
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
RUN /bin/dash ~/.profile
RUN /bin/dash nvm install 8.11.4
My issue is when I try to docker build -t imageName:version I would have an error :
/bin/dash: 0: Can't open nvm
The command '/bin/sh -c /bin/dash nvm install 8.11.4' returned a non-zero code: 1277
What could be the difference ?
Thank you David Maze. Indeed there is no need of nvm to install a specific version.
My Dockerfile now :
FROM wordpress:php7.0-apache
RUN apt-get update && apt-get install -y gnupg gnupg2 gnupg1
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get install -y nodejs

Getting this error on Ubuntu 16.04, Unable to locate package dotnet-dev-1.0.0-preview2

I followed the instruction from this link.
$ sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ xenial main" > /etc/apt/sources.list.d/dotnetdev.list'
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893
$ sudo apt-get update
Then while I run this command:
$ sudo apt-get install dotnet-dev-1.0.0-preview2.1-003177
I get the following error:
E: Unable to locate package dotnet-dev-1.0.0-preview2.1-003177
E: Couldn't find any package by regex 'dotnet-dev-1.0.0-preview2.1-003177'
Please help!
I just checked the repository pool and found they have changed their naming convention. In your above command the package name has been entered incorrectly:
dotnet-dev-1.0.0-preview2.1-003177
Where it should be:
dotnet-dev-1.0.0-preview2-1-003177
Notice the - instead of the .. If this is the issue then it is either a mistyped tutorial on the Microsoft site or a change in their naming scheme that hasn't been reflected everywhere.
You need to install HTTPS transport layer security for the apt-get application. The .NET Core repos are https, that is why they are not updated along with the other packages.
Simply type in the terminal
sudo apt-get install apt-transport-https
and your
sudo apt-get install dotnet-dev-1.0.0-preview2.1-003177
should work like a charm! (at least it did for me)
I'd leave this in a comment, or upvote the other comment that mentioned this fix, but because I am new I am not allowed to do any of those things. I just wanted to confirm that that fix worked for me.
make sure you don't get any errors while updating the package list. I had to install apt-transport-https before executing sudo apt-get update.

Cron job in Plesk

In Plesk panel I get the log error : wget command not found. But there is already wget command installed.
How could I solve this issue ?
cron command: wget -q -O – http://www.example.com/wp-cron.php?doing_wp_cron
This should simple and straight forward. what you need to do is install
On Ubuntu: sudo apt-get install wget
or on Fedora/Redhat/Centos: sudo yum install wget
make sure you have rights to run apt-get install or yum install. After you install wget that error in Plesk should go away. By the way, instead of wget -q -O you can also use cURL as an alternate solution to call your cron script.

Resources