unable to see grunt terminal after entering pig command? - apache-pig

unable to open grunt terminal after typing pig in Ubuntu, it got stuck and just blinks ,how to debug this issue, restarted the machine and checked .bashrc files.

**There is a file with 'pig' installed in (found this using locate command)
usr/games/
folder ... this is causing problem when i issue the pig command ,
i removed the file, rm -rf /usr/games/pig
and then issued pig command in ubuntu terminal it worked fine.**

Related

Environment variables (zsh terminal) installed through npm on MacOS 12.4 Monterey - SOLVED

Background:
Dear Stackoverflow community. I recently switched from Windows to MacOS and am at a loss how to configure environment variables. Many of the previous questions asked here are about bash instead of zsh.
Goal:
I am trying to install an npm package globally. For instance:
npm install -g vercel
or any other package, and use it in my Visual Studio Code terminal (also zsh). If I want to deploy code I have to use 'npx vercel deploy' every time. I want to be able to use "vercel deploy" but instead I get:
zsh: command not found: vercel
What I tried so far:
Installing the package in zsh and visual studio code terminals (didn't work)
Setting the path equal on both VS and terminal: export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
I learned that you need to add environment variabels to a .zshrc file. I don't seem to have a zshrc file. When I do:
sudo ~/.zshrc
Password: XXXXXX
sudo: /Users/vincent/.zshrc: command not found
I am getting another error.
I read in the zsh man file that you should use $HOME/.zshrc instead. Again I am getting the same errors:
vincent#Vincents-MacBook-Air-2 ~ % $HOME/.zshrc
zsh: permission denied: /Users/vincent/.zshrc
vincent#Vincents-MacBook-Air-2 ~ % sudo $HOME/.zshrc
sudo: /Users/vincent/.zshrc: command not found
Update 1:
#slebetman Thank you for your explanation. When I open the terminal I go to home via "cd $HOME" which puts me in in the home directory. However there is no way for me to create a .zshrc file in that directory. Neither via touch or vs code. I am getting the following error: "Unable to write file '/home/.zshrc' (Unknown (FileSystemError): Error: ENOTSUP: operation not supported on socket, open '/home/.zshrc')"
Update 2:
I did manage to find the .zshrc file in visual studio code under /etc. I hope this will work. I was able to overwrite the file with Sudo and add environment variables to it.
Add this to the file .zshrc file under /etc and force overwrite it:
export vercel=/Users/vincent/.npm-global/bin/vercel
Screenshots below for those who will try in the future:
Image with .zshrc file layout
Final remarks:
I don't understand how it is so difficult to add environment variables on Mac while everything else is so easy.
I have read many different questions on stackoverflow, and I can't seem to solve it. Also since I am a newbie I am not allowed to comment on there so I post here in the hope that anyone can help me :)
Best,
Vincent
Note that when you do:
npx vercel deploy
Npm will execute vercel for you without installing it. It does that by temporarily downloading vercel. If you want to run vercel directly without using npx then simply don't use npx. Install it instead:
npm install -g vercel
The -g flag installs the module globally and if the module has a CLI it will be available globally as well (note that depending on your setup you may need admin/sudo privileges to use the -g flag). Now you can run vercel by simply typing:
vercel deploy
This works in all operating systems supported by node.js and npm. That means you can even do this in Windows. In fact I use npm to distribute my tools in a simple cross-platform way so I don't have to support multiple package managers like chocolatey (Windows), homebrew (Mac OS), deb (Debian based distros), rpm (Redhat based distros) etc. (npm does not require your software to be written in node.js - I have published packages on npm written in tcl and bash).

nvm unable to switch version , show me error exec: "cmd": executable file not found in %PATH%:

C:\Users\HP>nvm list
16.13.0 (Currently using 64-bit executable)
15.0.0
C:\Users\HP>nvm use 15.0.0
exec: "cmd": executable file not found in %PATH%:
C:\Users\HP>nvm root
Current Root: C:\Users\HP\AppData\Roaming\nvm
C:\Users\HP>
Run nvm use 15.0.0 again as administrator, this works for me.
I had the same problem when i tried on vscode terminal, but I tried this on cmd instead of vscode terminal,
opened as administrator on cmd,
nvm use [version needed]
and it worked, even when I looked up nvm list on vscode terminal it was changed to my desired version

Why can't I run my node packages from the terminal?

Good evening,
I tried installing sails, yo, gulp & bower via the usual methods of npm i -g yo gulp bower etc but each time I open the terminal to run the command I always get the -bash: sails: command not found error.
I listed all my folders at the root of my folder and found the following:
The contents of the .npm-global/bin/ is actually all the packages I'm trying to use at the command line.
I decided to manual add the bin folder to the .bash_profile so it's contents was the following:
# Setting PATH for Python 3.7
# The original version is saved in su
export PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}"
export PATH="/.npm-global/bin:${PATH}"
but that didn't work either.
Here's where I think the problem first arose - I think that the python install overrode all the previous paths in the file (or moved them somewhere perhaps?) so that all previous terminal commands now don't work.
The usual global install for node packages (/usr/local/lib/node_modules/npm/bin) contains the following:
What am I misunderstanding here & how can I fix this?

"Spawn unknown" error while using npm's OpenFin

I installed OpenFin-cli using npm on windows 10. After OpenFin was installed, I tried to test it using the command
openfin -l -u https://apple.com
on cmd. I get the following error:
I have:
Node version 6.11.2
Link to OpenFin documentation that I referred: https://openfin.co/documentation/getting-started/
Can you try deleting the %LOCALAPPDATA%/OpenFin directory & re-running or downloading the OpenFinRVM.exe as suggested in this github issue
You can also try just manually launching the RVM by invoking the .exe with --config=http://yourappjsonurl.json
I believe the asset wasn't fully retrieved

Urturn API ur: command not found

I am trying to install urturn api and write my own expression for urturn.com
following http://webdoc.github.com/urturn-expression-api/#!guides/start
After:
npm install urturn-toolbelt -g
I am trying to run sandbox with:
ur sandbox
and got error:
-bash: ur: command not found
Please help
P.S. I am on Mac Os
thanks
It is likely your nodeJS npm/bin folder that is not included in your PATH.
Can you check your PATH variable?
Node NPM package bin files are all symlinked in the same ./bin folder. If you installed NodeJS using Homebrew (brew install node), it should be /usr/local/share/npm/bin.
You can echo your current path using:
echo $PATH
If the folder above does not appear in the list, check your .bashrc or .bash_profile files and fix any problem.
A fix that is likely to work is to add the following line in ~/.bash_profile
PATH=$PATH:/usr/local/share/npm/bin