Urturn API ur: command not found - api

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

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).

Bash: cordova: command not found on mac

I used command sudo npm install -g cordova to install cordova it shows result in terminal/Users/paramesh/.npm-packages/bin/cordova -> /Users/paramesh/.npm-packages/lib/node_modules/cordova/bin/cordova
+ cordova#8.0.0
updated 1 package in 47.732s
while creating project in cordova its bash: cordova not found
In my case, the path of npm was not set correctly. The package was installed on my local path even if I install it globally.
First, check npm path using npm root
If its not /usr/local/lib/node_modules then
set your path using npm config set prefix /usr/local
and again install you package npm install -g cordova
It's strange though that your system cannot find cordova after a global install with sudo. Have you tried reinstalling? If this doesn't help, try the following.
Restart the terminal and type this to check whether your system can find the cordova executable:
which cordova
If you get no output, it means your system cannot find the executable cordova binary. UNIX systems require executable binaries to be placed within the PATH environment variable. Try adding the following line in your ~/.bash_profile file:
$PATH=$PATH:/Users/paramesh/.npm-packages/lib/node_modules/cordova/bin/cordova
If you don't have a ~/.bash_profile, add it to the ~/.bashrc or ~/.profile file, whichever exists already. Then within the terminal you want to call cordova from, type:
source ~/.bash_profile
which cordova
This should give you the location of the cordova binary. Now you can use it.

Setting up a big commerce stencil environment

I am using a mac and have been following the instruction on how to set up a Big commerce stencil development environment posted here:
https://stencil.bigcommerce.com/docs/prerequisites
When trying to launch stencil:
stencil start
in the template directory called "airflow" - see screenshot for the directory structure - I receive:
-bash: stencil: command not found
directory structure
I have been trough the trouble shooting pages
and verified I have the correct versions of npm, node and nvm
npm -v
2.14.20
node -v
v4.4.0
I have also confirmed there is only one version of node installed:
ls ~/.nvm/versions/node
v4.4.0
Is there any advice anyone can give on how to troubleshoot this?
Many Thanks
Are you sure you installed stencil-cli globally? Run npm ls -g --depth=0 and confirm that #bigcommerce/stencil-cli is listed. If not, install it with the -g flag...ie: npm install -g #bigcommerce/stencil-cli
Second, make sure you're running the stencil commands in the directory that contains the .stencil file...in your screenshot that'd be the "stencil" directory inside of "airflow".
Hope this helps!

apidocjs not returning anything in response

I have installed 'apidoc' after installing 'npm' and 'node' for my API documentation by the help of following command:
npm install apidoc -g
After installing apidoc globally, I simply ran below command on my project directory (assuming apidoc will consider its default template file):
apidoc
In result no errors and no documentation generated.
Similarly, I have tried:
apidoc -i ~/PROJECTS/jruby/project/webservice/ -o ~/PROJECTS/apidocs/apidoc/ -t ~/PROJECTS/apidocs/mytemplate/
But nothing happens, in that case I had nothing on 'mytemplate' directory.
Can you guys please tell me what I've missed to install/consider? and why nothing is appearing on command execution?
Note: I'm using this for my ruby application, but unable to install its gem as we're running our application on ruby 1.9 and it requires ruby 2.0. I need an independent solution that should works for other projects as well.
Thank you.
I got the solution; copied 'package.json' file from https://github.com/apidoc/apidoc and ran below command for npm
npm install
after getting success install nodejs properly by following steps:
curl -sL https://deb.nodesource.com/setup | sudo bash -
sudo apt-get install nodejs
then went to the project directory and ran the following command:
apidoc
after success of above command got html document in doc/ directory inside project. Cheers !

Can't compile .deb packages; make package command returns error

When I try to compile a Notification Center widget for iOS 5 using
cd <name>
make package
then I get the following error:
make package requires dpkg-deb.
make: *** [package] Error 1
But I have installed dpkg-deb using
sudo su
<enter your password>
cd /bin
curl http://debmaker-osx.googlecode.com/svn-history/r5/trunk/dpkg-deb > dpkg-deb
And I have navigated to the /bin directory and the dpkg-deb file exists in the folder. What can I do to make it work? I have followed this tutorial on how to install theos, dpkg-deb and how to create a WeeAppPlugin, I'm just stuck at compiling the bundle... http://weeplugins.com/blog/?p=1
Update:
It seems like I cannot access the /bin/dpkg-deb file if I run this command
cd /bin/dpkg-deb
I get an error that I don't have permission to access the file. Is it possible to maybe move the file to another folder so that i can access it?
Along with MacPorts I also had to install the Xcode command line tools and Fink http://www.finkproject.org/
You can try to do "sudo make package". This will give you superuser permissions.