MacOS: yeoman: command not found - angularjs

I know that there are many other questions towards this topic. But none of the answers helped for me :(
I simply want to do some AngularJS development using Yeoman. So here's what I did (on MacOS Yosemite):
installed Node.JS by downloading the PKG from the website
installed Yeoman by this command line npm install -g yo grunt-cli bower
When I then type yeoman or yo in the terminal, then I get -bash: yeoman: command not found error.
NodeJS is installed in /usr/local/bin/node
NPM is installed in /usr/local/bin/npm
Following other postings, I tried to change my $PATH variable but still did not work.
echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin/npm:/usr/local/bin/npm/bin:/usr/texbin:/Users/mheise/.node/bin
echo $NODE_PATH (empty)
Any ideas?

Related

node HTTP-Server is not working properly?

when i install http-server in c: drive it install automatically in d: drive.
here is the result:-
C:\Users\Kuncham>npm install http-server -g
D:\usr\local\http-server -> D:\usr\local\node_modules\http-server\bin\http-server
D:\usr\local\hs -> D:\usr\local\node_modules\http-server\bin\http-server
+ http-server#0.11.1
updated 1 package in 1.131s
after installation when i run http-server in my project folder it will start the http-server and also we can access the link given in command prompt. the browser will show only files not run the my angular application.
Install http-server using npm install -g http-server command
Generate a build by using ng build --prod command
Go to dist/project_name from cmd
Type http-server -p 8080 on cmd
Type http://localhost:8080/ on browser
Perform an ng build on the directory and point your http-server at the resulting dist/ folder, which contains the compiled HTML and Javascript files your browser can consume.
More information: Angular - Deployment
I just installed http-server today and my problem was it just wasn't serving the content at all when I went to localhost:8080. The command prompt would flash for a second and disappear. I resolved my problem by hitting http://192.168.40.78:8080. http-server lists two urls you could hit. The 192 one worked, but not the localhost one.
specify the file when running http-server
http-server [path] [options]
[path] defaults to ./public if the folder exists, and ./ otherwise.

How to go from codepen to running locally on pc

I would like to run the following codepen on my PC?
http://codepen.io/kyleledbetter/pen/gbQOaV
I have nodejs installed, and have exported the codepen as a zip, extracted in -
but how do i actually run it?
I have tried 'http-server ./d' ? and 'npm run serve'. Sorry this is a newb question, but I can't find documentation on web for it, or in angularmaterialwebsite.
First install http-server package npmjs.com using following command
$ npm install http-server -g
then on you run a http-server pointing to your extracted folder using following command
$ http-server path/to/your/extracted/folder -p 8989

error: import pychart , during install source code odoo 9.0

I wrote so many thing in requirements.txt and reinstalled but it didn't work out. I installed odoo 9.0 source code for windows. The command prompt is showing error:
from pychart import *
What do I need to write in requirements.txt for pychart?
As i just ran into the same problem unrelated to odoo.
The following command solved it for me:
pip install Python-Chart
To install the python packages for odoo you can use below command found from this detailed odoo install guide
cd /tmp && wget https://raw.githubusercontent.com/odoo/odoo/9.0/requirements.txt && sudo pip install -r requirements.txt
It will install all the python dependacy in just one command.
Hope this helps.
You have to install that package before you use that, If are on ubuntu command is pip install pychart and if you are on windows the command is c:\Python27\Scripts\pip.exe install pychart.I assume you have installed python on default folder c drive.
Why don't you create a module like install_module and on depends you can add required list of module to install. If you install that module it'll automatically install all depended module. I'm using this same. Instead of command prompt it'll be quite easy too. You can view the depends module list in Technical Data of that install_modules.
I Hope it'll be helpful.

"Yo angular" command always download the folders and files in the angular-generator folder

I have problem when I use "yo angular" command.
The problem is that the generator always download and install folders and files in the following route: C:\Users\MyUser\AppData\Roaming\npm\node_modules\generator-angular and don't in the folder where I am in the terminal.
I use Windows 7 64 bits. I installed the generator with "npm install -g generator-angular" and install with "yo angular" command. I have no idea how to solve this problem

npm / yeoman install generator-angular without sudo

I tried to install generator-angularjs using Yo (Yoeman) without sudo:
npm install -g generator-angular
I get:
Error: EACCES, mkdir '/usr/lib/node_modules/generator-angular'
When I type in sudo yo, yo tells me that I should not use sudo (which is perfectly understandable).
I have a ~/node_modules directory - why doesn't yo install its packages there?
Generators are designed to be installed globally. Otherwise, you always have to install the generator you're about to use in each project, which is unnecessarily painful. Also, you don't get to see the lovely yo menu which lists you all the available generators (unless of course, you install them all locally):
Setting up npm for global installation
So, how do we get npm to install packages globally? As you correctly said, you should never, ever run yo with sudo. There are lots of different solutions to this problem and you can spend hours discussing their pros and cons religiously.
I personally dislike installing my user packages into the global /usr/ folder. /usr/ is for software that is shared across all users on the computer. Even if it's only using the machine, there are still good reasons to respect the way the Unix file system hierarchy is designed. For example if you decide at one point to wipe your whole node installation.
My preferred way of enabling npm to install packages globally without breaking out of $HOME is to set a local node prefix. This is as easy as running
echo 'prefix = ~/.node' >> ~/.npmrc
in your local shell. After that, you want to adjust your $PATH, to point to the new installation destination for global node executables by adjusting your favorite shell's config. E.g. by adding
export PATH="$PATH:$HOME/.node/bin"
to your ~/.bashrc. After that, you can happily run npm install -g generator-angular without sudo, without running into permission conflicts and if something is completely broken and you want to start from scratch, all you need to do is remove your ~/.node directory.
Thanks to #passy I managed to finally get this working on ubuntu 13.04 (in case anyone is having similar set up issues) with the following :
sudo apt-get update
sudo apt-get install python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
trying to run:
npm install -g yo
resulted in
Error: EACCES, mkdir '/usr/lib/node_modules/yo'
Fixed using:
echo prefix = ~/.node >> ~/.npmrc
echo 'export PATH=$HOME/.node/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
Running:
yo webapp
resulted in:
Error: EACCES, permission denied '/home/username/.config/configstore/update-notifier-yo.yml'
Fixed using:
sudo chown yourusername:yourusername /home/yourusername/.config/configstore/update-notifier-yo.yml
hi in my case (on ubuntu 12.04), the prefix addition in ~/.npmrc did not changed anything.
if so, build the node package by yourself and install it in /opt/node or /home/user/.node.
I had an almost identical error involving a rogue .yo-rc.json file in my root directory from a project I installed earlier. Yeoman was switching cwd from the installation dir to root dir half way through the installation, but was only outputting the EACCESS permissions error without any details that the installation directory was /. It took ages to figure out why this was, and involved debugging through the Yeoman source, but I eventually learned that Yeoman will look up through the directory tree until it finds a .yo-rc.json, and generate the code there by calling chdir to the new location.
Yeoman should maybe check that the user has write permissions for the directory. Alternatively, it could mention in the output either that the cwd has changed, or print the name of the installation directory if where it finds .yo-rc.json is different than cwd.
The command for finding rogue .yo-rc.json files
sudo find / -name .yo-rc.json
From yoeman getting started page appears the command:
yo doctor
In my case, $NODE_PATH (which in my case, Ubuntu 14.04, is defined in /etc/profile.d) isn't the same than npm root. Adding in npm root in $NODE_PATH solve the problem.
I have been trying to get yeoman to play nice with my vagrant box and this is what I had to do to install npm packages globally without sudo on ubuntu:
1. Create the directory to store global packages
$ mkdir "${HOME}/.npm-packages"
2. Tell npm where to put any packages installed globally
Insert this snippet into your ~/.npmrc file:
prefix=${HOME}/.npm-packages
3. Make sure that npm can locate installed binaries et cetera
Insert this snippet into your .bashrc/.zshrc:
NPM_PACKAGES="${HOME}/.npm-packages"
PATH="$NPM_PACKAGES/bin:$PATH"
// `unset` `manpath` to allow inheritance from `/etc/manpath` with
// the `manpath` command
unset MANPATH // remove this line if you have previously modified `manpath`
export MANPATH="$NPM_PACKAGES/share/man:$(manpath)"
4. Run the following or restart terminal
$ source ~/.bashrc
Hope this helps anyone who finds themselves in a similar situation.

Resources