Can't unzip Chef cookbooks on Windows Command Line - 'tar' not recognized - command-line

Unfortunately stuck using Windows command line as opposed to Linux bash...
When installing chef cookbooks from command line using
knife cookbook site install COOKBOOK
the COOKBOOK.tar.gz file will download but won't extract. How can I make this happen in Windows Command line?
The error messages received
ERROR: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
...
STDERR: 'tar' is not recognized as an internal or external command, operable program or batch file
What do I need to do for the cookbook to automatically install as it normally should?
EDIT: ADDITIONAL INFO: cygwin & ruby are also installed.
The tar package is installed and can unzip files using
tar xvzf apt.tar.gz

If you have git windows installed then use the git bash shell

The problem is with the PATH variable in Windows.
Ensure the PATH environment variable doesn't contain any spaces.
If there are spaces, remove them OR
move the paths applicable to your chef installation to the beginning of the PATH variable
D:\Programs\Git\cmd;D:\Programs\cygwin\bin;D:\Programs\chef\bin;RESTOFPATH

Related

'raml2html' is not recognized though installed via npm i -g raml2html: Windows

I was trying to run raml2html to convert some contracts to HTML, this was working initially when first time I did the installation on my Windows machine but after some weeks when I tired running this again then this command stopped working. Not sure what happened.
What I again tired installing raml2html by running npm i -g raml2html but still its saying:
'raml2html' is not recognized as an internal or external command,
operable program or batch file.
I again tried uninstalling and reinstalling also but still the same issue.
Try to find where the installation is creating the command line script for Windows (a file ending .cmd). That can be found opening a Powershell terminal and using the where command. It usually is under the C:\Users\<YourUserName>\AppData\Roaming\npm\node_modules directory.

Why aren't Tesseract and GhostScript recognized as commands?

I have a large batch of PDFs that I can't OCR because they've each got a small field of renderable text.
I'm trying to convert them all to TIFF so I can convert back and run OCR, but I'm running into problems invoking the programs that I'd expect to do the job. I installed them without issue, but for some reason, I keep getting errors saying the associated commands don't exist:
c:\Program Files\Python37\Lib\site-packages>pip install tesseract
Requirement already satisfied: tesseract in c:\program files\python37\lib\site-packages (0.1.3)
c:\Program Files\Python37\Lib\site-packages>tesseract --version
'tesseract' is not recognized as an internal or external command,
operable program or batch file.
c:\Program Files\Python37\Lib\site-packages>pip install ghostscript
Requirement already satisfied: ghostscript in c:\program files\python37\lib\site-packages (0.6)
Requirement already satisfied: setuptools in c:\program files\python37\lib\site-packages (from ghostscript) (40.8.0)
c:\Program Files\Python37\Lib\site-packages>gs --version
'gs' is not recognized as an internal or external command,
operable program or batch file.
c:\Program Files\Python37\Lib\site-packages>gswin32c --version
'gswin32c' is not recognized as an internal or external command,
operable program or batch file.
Any ideas what I'm doing wrong?
Bonus points if you've got a better way to perform the overall task.
I notice you are using Windows, I would guess that you haev not added the Ghostscript install directory to the $PATH environment variable, and so Windows does not know where to look to find the executable.
It may be that Python can use the Ghostscript executable from the python37\lib\site-packages directory, but Windows won't know that unless its been told to look there. It'll probably be a sub-directory, unless the Python package installer uses something other than the normal Ghostscript Windows installer.
Note that on Windows the binary is not called 'gs'; it will be either gswin32, gswin64, gswin32c or gswin64c depending on whether you installed the 32 or 64-bit version of Ghostscript, and whether you want the command line (c) or windowed version.
Probably the easiest way to find it is to look in the specified Python folder and see.

npm install -g generates the wrong script

This is a follow up this previous question related to how to install and run a javascript node.js command line tool.
According to this enter link description here you must execute npm install -g from within the folder of your project in order to be installed as a global command line tool executable from prompt.
When I run this instruction a .cmd file is created inside de global npm folder. But its content is wrong:
#"%~dp0\node_modules\lb-model-discovery\index.js" %*
I must manually change this content for it to be executed (otherwise I just get notepad being opened...) My question why npm install -g does not produced the right script in my system?
The solution is found in this github issue.
Basically the entry script (index.js) must contain this line at the top:
#!/usr/bin/env node

Command Prompt on Windows 8 not recognizing any commands

Here's a screenshot of the command prompt message:
It says "'$' is not recognized as an internal or external command, operable program or batch file."
I looked up how to fix it, then changed the PATH in computer properties and updated my Java like they said, but it's still not fixed.
Is gem the name of a program you're trying to run? Because you can just type gem install jekyll without the $. The gem executable would have to be in a folder that's present in the PATH variable.

Creating new file with Node.js and Express

I'm trying to learn how to use Node.js and its packages. I'm in my Command Prompt (I'm on Windows), changed directory to my project folder. Then I installed the Express package:
npm install express --save
The npm installed the Express package. Now, while I'm still in the directory, I'm trying to create a new file:
touch index.js
But the file isn't created and I'm getting the following message:
'touch' is not recognized as an internal or external command, operable program or batch file.
Why is that? What am I doing wrong?
touch is no Windows command.
In this answer, they suggest this as an equivalent:
echo $null >> filename
touch is a Unix command that creates an empty file (or updates its timestamp if it doesn't exist). It has nothing to do with Node specifically.
Most Unix distributions (including OSX) will have touch installed by default. So I suspect you're on a Windows machine....