Creating custom gutenberg block gives 'Unexpected token .' - wordpress

I am trying to create a custom gutenberg block to use in the wordpress gutenberg editor but when trying the command: npx #wordpress/create-block test-block it starts with installing a few things but all of a sudden I get:
npx: installed 126 in 13.341s
Unexpected token .
What is causing this?
I am following this tutorial: https://kinsta.com/blog/gutenberg-blocks/ except I am not using any of the hosting options from the tutorial since I have my own wordpress installation already running (locally).

Check your node version, I got the same error using node.js version 12, then I changed it to versi

For folks on Ubuntu: I ran into the same issue and found that the nodejs installable via apt is out of date. I had to download the tarfile from nodejs.org and install it with the help of How to install node.tar.xz file in linux. After that it ran as I expected.
(I tried the LTS version. node --version returns v18.12.0)

I also had this problem. All I needed to do was to update my Node version.
I followed these steps (run in Mac Terminal):
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
Hope this helps.

Related

I am not able to install Apache Airflow in Windows

My attempts include:
[ here i have python 3.9 so my constraints is 3.9]
I created a virtual environment and attempted to install Apache-Airflow by using pip install 'apache-airflow==2.5.1' / —constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.5.1/constraints-3.9.txt," but I received an error that I couldn't understand, so I looked on the stack community for advice and learned that I needed to add -t, which I did.
but then I started getting permission errors, then I went into community posts and how to fix permission errors, and it was suggested that I should run command prompt as administrator and then install unfortunately this thing isn't working for me
I've tried running cmd as administrator, going to my project's directory, activating virtualenv, and installing the library, but I still get the same problem. PermissionError: [WinError 5] Access is denied: 'D:\\'
Thanks in advance.
Try removing the slash (/) from the command before the --constraint and then running inside the cmd terminal; it will work.
pip install apache-airflow==2.5.1 --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.5.1/constraints-3.9.txt"
Note : Please be aware that the above recommendation is for Windows, but even if it is successfully installed you won't be able to run airflow because of the files used, such as pwd and others. Therefore, I will recommend that you use airflow in Windows using Ubuntu. You can follow this link to install Ubuntu in your system and set up airflow.
youtube-video-url

DPDK install using Meson and Ninja

I wanted to try learn things in DPDK in Debian 10 buster VM.
I have taken DPDK 20.08 as source.
I followed steps as mentioned in Compiling the DPDK Target from Source https://doc.dpdk.org/guides/linux_gsg/build_dpdk.html#uncompress-dpdk-and-browse-sources
I have tried to follow the below steps
tar xJf dpdk-<version>.tar.xz
cd dpdk-<version>
meson build
cd build
ninja
ninja install
ldconfig
On the above when I tried
ninja
it works. Then I went for next command
If I try with
sudo ninja install
from dpdk build directory
it says sudo: ninja: command not found
If I try
ninja install with out sudo
it gets terminated with error.
It asks for sudo password then shows
ModuleNotFoundError: No module named mesonbuild
Failed Meson-install
ninja:build stopped:subcommand failed
Would appreciate your help to resolve this step.
Edit
Repeated steps with root account. Problem didn't occur. Initially it was looking in /home/vijay/.local/bin folder. Then I used from /usr/local/bin/meson
The error information ninja: command not found could be 1 of the 2 things
either NINJA utility is not installed
or PATH for NINJA Binary is incorrect
As recommended in the comment, ensure 'ninja' is installed and you have the right path like /usr/bin/ for the same.
[EDIT] #Vijay has updated it is indeed the path related issue.

Symfony Installation gives fatal error

I'm new to the symfony2 and I was following http://symfony.com/doc/current/book/installation.html for installation using Composer now
It gives me a Fatal Error after some time:
monolog/monolog suggests installing rollbar/rollbar (Allow sending log messages to Rollbar)
Writing lock file
Generating autoload files
Fatal error: Call to undefined method Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::defineDirectoryStructure() in /Users/app/SymfonyStandard/RootPackageInstallSubscriber.php on line 28
#hap absolutely right on Debian/Ubuntu
sudo apt-get install php5-curl
is solving this issue. I think on another platform php5-curl will help too.
RESOLVED:
Got the same problem. Deleted the file composer.phar, installed again via curl -s https://getcomposer.org/installer | php - problem persists
/path/to/webroot/project/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/ScriptHandler.php file does not have the method defineDirectoryStructure() in it
symfony/framework-standard-edition (v2.6.1)
PHP 5.5.9-1ubuntu4.5 (cli) (built: Oct 29 2014 11:59:10)
problem here
sensio/distribution-bundle (v3.0.11)
Thanks #hap, this helped
sudo apt-get install php5-curl
Just had this problem on Debian. For me the problem was that sensio/distribution-bundle in its last version (v3.0.12, the one introducing the defineDirectoryStructure function) requires the cURL PHP extension, which was not installed, so it installed v3.0.11 (which don't contain the required method).
After installing php5-curl, Composer finaly installed the last version of sensio/distribution-bundle and everything was fine.
Got the same problem too ... Works on a debian distrib, but doesn't work on my wamp on windows 7 !
So tried to update my wamp, to get PHP5.5, reconfigure composer to use this PHP, still didn't work ..
Then I tried to launch the Console in Administrator mode, and launch :
"composer create-project symfony/framework-standard-edition sfproject/"
And guess what .... That finally worked !! With administrator rights ... Just give it a try ;)
I have same problem. I just added in composer.json string "symfony/symfony": "2.3.*", And its working for me.
Also, i deleted my composer.phar and composer.lock files.
The problem, if you have in your project symfony 2.3 it installing dependencies for v 2.7 .
I got this error from a install into a new vagrant VM, it would appear that something done recently has broken this as I managed to install a 2.6.0 version last week whilst testing, now it doesn't work.
After a bit of trial and error, it appears that the 2.6x and 2.5x branches are both affected and will not install, but 2.3x and 2.4x do install without the error.
incase anyone doesn't know how to install a specific version, just add it onto the end of the composer command, i.e.
composer create-project symfony/framework-standard-edition . 2.4.x
VM: Ubuntu 14.01 / PHP 5.5.9
I had the same problem in an Ubuntu 14.04 VM set up with PuPHPet and Vagrant/VirtualBox.
I've noticed that when I had the same problem, the DistributionBundle was severely out of date. Trying to upgrade it manually from composer.json (changing the version to 3.0.12, which was the las one available at the time I had the problem) produced a more verbose error, stating I hadn't installed php5-curl.
After updating the PuPHPet config file to include the cURL module for PHP and reprovisioning my VM, Symfony installed just fine, having installed the last version of Sensio Distribution Bundle, which contained the defineDirectoryStructure() method.

Error: Wrong export slider file format! This could be caused because the ZipArchive extension is not enabled

I'm getting this error while trying to import sliders in Revolution Slider Wordpress plugin:
Error: Wrong export slider file format! This could be caused because the ZipArchive extension is not enabled.
In my case the ZipArchive extension is installed and active (check: http://www.digitpro.it/tools/info.php) so none of other replies on the web applies.
Looks like the ZipArchive PHP extension is not installed on your server.
You can see there for more info: http://portfoliotheme.org/support/forums/topic/error-importing-sample-revolution-sliders/
When upgrading to PHP 7, you should make sure to install the PHP 7 versions of you libraries as well. The PPA providing PHP 7 also provides a php7.0-zip package. You can install it with:
sudo apt-get install php7.0-zip
To see additional PHP 7 libraries that are available, run:
sudo apt-cache search php7.0-*

Amazon EC2 - PHP GD image library

I've got a brand new install of WordPress setup and activated a custom-built theme along with a good amount of plugins. In the posts, I have built it so the user can create a post, upload an image as a thumbnail and it will automatically resize the image to a custom size set in my functions.php file.
All this has been working on my local end (MAMP) correctly but when I tried making everything work on our Amazon EC2 server, the images do not resize to the size set. They resize by actual code but do not resize the actual image and save it in the new size.
Apologies if the question/subject is completely non-sense but I have little to no experience with Amazon EC2 servers and I have been placed into a situation where the person in charge of all the work within EC2 had to leave the project.
I'm assuming that this has to do with the GD library not being installed.. I created a test page with phpinfo() and didn't see a GD area on the results page.
How would I go about installing the library on my Amazon EC2 server? I just learned how to connect to the server via Terminal and that's all I've got for now.. so you get an idea of how much I know about the subject.
I'm guessing you have some type of Linux installed, probably Ubuntu or CentOS.
Ubuntu: sudo apt-get install php5-gd
CentOS: sudo yum install php-gd
You probably have to restart Apache afterwards: service httpd restart or service apache2 restart -- the names differ from distribution to distribution.
Let me know if this works!
In my case, I was getting error like there is version conflict between different versions of php-common when I entered "yum install php-gd" so I checked my php version using "php -v" in shell and then installed the corresponding gd using "yum install php56-gd" because I had php 5.6 installed in my machine.
Hope someone will get help from this.
Cheers
to avoid compatibility problems first do:
php --version
to know your php version
the answer is something in the form PHP X.Y.Z
so you have to take X, Y and do:
sudo yum install phpXY-gd
for instance if php --version says PHP 5.5.26
you will do:
sudo yum install php55-gd
In my case of ec2 server running Amazon Linux 2 with php version 7.2.24, following was the sequence:
sudo yum install php-gd
But event after repeat server restart with
sudo systemctl restart httpd
it was not working unless I rebooted with
sudo reboot
In Amazon Linux, we have to add the following line to the etc/php.ini file
extension=gd.so
Step 1: Install the package using following command
sudo yum install php-gd
Step 2: Include the following line to the etc/php.ini file
extension=gd.so
If the line is commented, then uncomment it.
Step 3: Restart the httpd service
sudo service httpd restart

Resources