I want convert some wordpress .po language files to .json format and used wp-cli but PO files converted to multi files of json but I need to a single json file.
So installed po2json using:
npm install po2json
I am getting this error:
C:\Users\Mehdi\Desktop\po2json 1.0.0>po2json translation.po translation.json
'po2json' is not recognized as an internal or external command,
operable program or batch file.
Can anybody help me to use po2json easily?
I have tried to install https://openbase.com/js/#myrotvorets/po2json using:
npm i #myrotvorets/po2json
And finally I got the output with the following code:
po2json sourcefile.po > destfile.json
Related
I am new to Rmarkdown and trying to learn how to knit a code. when I run the sample code and knit, it gives me the following error:
*
Error running filter C:/Users/bbalamdari/Documents/R/win-library/3.6/rmarkdown/rmd/lua/pagebreak.lua:
...uments/R/win-library/3.6/rmarkdown/rmd/lua/pagebreak.lua:18: module 'pandoc.utils' not found:
no field package.preload['pandoc.utils']
no file 'C:\PROGRA~2\Pandoc\lua\pandoc\utils.lua'
no file 'C:\PROGRA~2\Pandoc\lua\pandoc\utils\init.lua'
no file 'C:\PROGRA~2\Pandoc\pandoc\utils.lua'
no file 'C:\PROGRA~2\Pandoc\pandoc\utils\init.lua'
no file 'C:\PROGRA~2\Pandoc\..\share\lua\5.3\pandoc\utils.lua'
no file 'C:\PROGRA~2\Pandoc\..\share\lua\5.3\pandoc\utils\init.lua'
no file '.\pandoc\utils.lua'
no file '.\pandoc\utils\init.lua'
no file 'C:\PROGRA~2\Pandoc\pandoc\utils.dll'
no file 'C:\PROGRA~2\Pandoc\..\lib\lua\5.3\pandoc\utils.dll'
no file 'C:\PROGRA~2\Pandoc\loadall.dll'
no file '.\pandoc\utils.dll'
no file 'C:\PROGRA~2\Pandoc\pandoc.dll'
no file 'C:\PROGRA~2\Pandoc\..\lib\lua\5.3\pandoc.dll'
no file 'C:\PROGRA~2\Pandoc\loadall.dll'
no file '.\pandoc.dll'
Error: pandoc document conversion failed with error 83
Execution halted
*
I thought perhaps I should install package"Pandoc.utils" but once I called the package in R, it gave this error:
package ‘pandoc.utils’ is not available (for R version 3.6.0)
Is this because I have the latest version of R and it cant install the older version of pandoc? does anyone know what is going on?
It looks like rmarkdown can't find pandoc. RStudio typically includes the pandoc files in your\path\to\Rstudio\bin\pandoc. When you open RStudio, it secretly sets an environment variable named RSTUDIO_PANDOC which rmarkdown uses to find pandoc.
Run the command Sys.getenv("RSTUDIO_PANDOC"), which should return the location of your pandoc installation. If it doesn't, that is likely to be your problem.
Once you find where RStudio is installed, you can set this environment variable with Sys.setenv(RSTUDIO_PANDOC = "your/path/to/Rstudio/bin/pandoc"). After that (assuming this is your problem) you should be able to knit the document as expected.
I had this problem at my Windows 10 desktop, and fixed it.
There is a long command before your error in the R Markdown terminal if you use Rstudio. It may looks like this:
"C:/Users/15510/AppData/Local/Pandoc/pandoc" ...
And it is inconsistent with my Sys.getenv("RSTUDIO_PANDOC"), which is "C:/Program Files/RStudio/bin/pandoc/pandoc"
So I remove my pandoc path(C:/Users/15510/AppData/Local/Pandoc/pandoc) from the system environment in Windows, and then the rmd can run successfully with the terminal saying this:
"C:/Program Files/RStudio/bin/pandoc/pandoc" ...
P.S. I guess you have installed pandoc in your user directory, maybe you can check your system path of the computer.
Unfortunately, none of the above worked for me. Surprisingly, disconnecting from the internet helped. May be this will help someone else too.
I'm trying to create my Starter Pack Setup and I need to install NPM dependencies. I should create a json file in: /Users/matteomattiussi/Documents/Udemy/Bootstrap/bs4projects/bs4starter
but I don't know how do it because I always getting the json file in:
/Users/matteomattiussi/package.json
Can someone help me, please?
In order to create a package.json file in /Users/matteomattiussi/Documents/Udemy/Bootstrap/bs4projects/bs4starter (if the directory already exists and you have npm installed):
cd /Users/matteomattiussi/Documents/Udemy/Bootstrap/bs4projects/bs4starter
npm init
In using package.json:
This will initiate a command line questionnaire that will conclude
with the creation of a package.json in the directory you initiated the
command.
You can use online JSON compiler and then download it in your directory. https://jsoneditoronline.org/
This is a example of a site which can create JSON file online.
I am very new to the concept of npm-install. Please throw some insights into where I might be going wrong. I have a .js file through which I am supposed to invoke a binary with some command line arguments.I did write package.json setting the main parameter to the javascript file and I am using preinstall script that compiles the code and creates a binary that is supposed to be used by my java script file.
Couple of questions:
How do I make package.json take this compiled binary as dependency for the js file?
npm install runs fine for me but I do not see any output folder whatsoever. I was hoping it would generate a .node_module in pwd and copy the contents onto bin/ folder in that. May be, I am missing something.
npm info prepublish test#0v.0.1
npm verb from cache <pwd>/package.json
npm verb readInstalled returning test#0.0.1
npm verb exit [ 0, true ]
npm info ok
Can someone please through some insights into this issue?
You don't have to include your binary file in package.json. If you're using Express, put it in the node-modules folder within the parent directory. Otherwise, you can either specify the whole path to the file where you call it or put the file in the parent directory. For global installations, the node-modules folder is usually created at: C:\Users\[Username]\AppData\Roaming\npm\node_modules.
I figured out a way to handle it. Using a js module and using my node as required in that module causes npm to setup my node in node_modules/ folder. I used a pre-install shell script to compile my binary and used the relative path to use the binary upon execution.
Thanks for all who replied.
I have a firebreath plugin with installer.cmake script for Mac. Instead of creating a dmg file it creates a package based on pmdoc folder.
COMMAND ${CMD_CP} -r ${CMAKE_CURRENT_SOURCE_DIR}/Mac/MyPlugin.pmdoc ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/MyPlugin.pmdoc
COMMAND /Applications/PackageMaker.app/Contents/MacOS/PackageMaker --doc ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/MyPlugin.pmdoc --version ${FBSTRING_PLUGIN_VERSION} --out ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/MyPlugin.pkg
Problem is I want to use FB variables in one of the pmdoc file, for example set title to ${FBSTRING_PluginName} ${FBSTRING_PLUGIN_VERSION} Obviously, copy command just copies the file, but how can I replace variables with their values?
Use cmake's configure_file. This will take an input file and an output file; the output file will have all variables replaced. Lots of examples of this in the firebreath codebase.
My host (iPage) does not have JSON.pm installed. I don't want to use the modules they have installed (XML) in order to transfer data from a CGI script back to a web page. Is there anyway that I can use JSON without them installing it on Perl?
The reason I ask is because I noticed when I downloaded the JSON zip that I had to run a makefile json.pm command but I don't have access to a Unix shell or a SSH terminal.
If your Perl is new enough, 5.14 and up, it will come with JSON::PP, a pure Perl implementation of the JSON parser. Confusingly it does not come with JSON.pm. So try use JSON::PP and see if it works.
Otherwise, follow Ilmari's instructions. If you switch to a host with shell access, you can use local::lib to manage CPAN modules.
You should be able to install a local copy of the pure Perl version of the JSON module without shell access. Just download the .tar.gz archive to your own computer, unpack it and copy everything under the lib subdirectory to a suitable location on your webhost.
You'll also need to tell Perl where to find the module, for which you need to know the filesystem path to which you copied the module. For example, if you copied the contents of the lib directory to /home/username/perl-lib on your webhost, then you would include in your code the lines:
use lib '/home/username/perl-lib';
use JSON;
Depending on how your webhost is configured, you might also be able to use $ENV{HOME} to obtain the path to your home directory, so that you can write:
use lib "$ENV{HOME}/perl-lib";
use JSON;
or you could try using the FindBin module to find the path to the directory containing your script, and locate the lib directory from there (see the example in the FindBin documentation).