installing nodejs module doesnt give me the command - node.js

I am trying to run pixel-ping and running into trouble. I followed these instructions:
http://documentcloud.github.io/pixel-ping/
and it mentions that Installing Pixel Ping gives you the pixel-ping command. but when I type pixel-ping path/to/config.json it returns -bash: pixel-ping: command not found
I am not sure why it would say that any ideas would be greatly appreciated. I have both nodejs and npm installed I have other modules working perfectly. Am I doing something wrong ?

curl npmjs.org/install.sh | sudo sh
Install Pixel Ping via NPM:
sudo npm install -g pixel-ping
Restart shell
Also ensure
~/npm/bin is in the Path

Related

Trying to install less on Ubuntu 16.04

As I wrote up there I'm trying to install less on Ubuntu. I'm using Xampp as localhost, but from what I've read seems that it doesn't matter. However, after I've installed node.js from nodejs.org, I went to lesscss.org and I followed the instructions.
When I type this command on the terminal
lessc styles.less
I get the following error
lessc: ENOENT: no such file or directory, open '/path/to/cwd/styles.less'
where the path corresponds to my actual path but there isn't any styles.less file of course. I also tried to create a blank one and retry but nothing. What should I do ?
You probably need to install less using npm install -g less. lessc should be available as /usr/bin/lessc.
Also, make sure /usr/bin is on your path by running echo $PATH.
EDIT
I just noticed you were able to run it. You need to create some .less files and run lessc <FILENAME>. The output will be printed out to the screen but you can specify a destination file as well, lessc <SOURCE> <DESTINATION>. See command line usage I recommend using a build tool such as gulp or webpack.
STEPS TO INSTALL LESS IN UBUNTU 16.04
Open Terminal.
Check availability of npm. Write "npm -v", here -v means version.
If there is npm by default in your system then it will show you the version of that npm. If there is no npm installed in your system then it will ask you to install the npm.
To install npm in your ubuntu. Write "sudo apt install npm".
Now you have to install the less library. So, to install less. Write 2 commands accordingly:-
(i) sudo apt install less
(ii) sudo apt install node-less

sh.exe": http-server: command not found

After I ran following command
npm install
it was successfully executed
But when i tried to execute following command
http-server
It gave following error
sh.exe": http-server: command not found
Can somebody help me out to solve the above error
You have installed the http-server package locally, rather than globally.
Check the node_modules/.bin/ folder, find the executable and execute that.
If that works try $(npm bin)/http-server if you are running from git bash. If you use the windows command prompt try node_modules\.bin\http-server.cmd from the same folder where you ran npm install

How can I get the slc command to work on Ubuntu?

I have installed Strongloop using npm install -g strongloop on my Ubuntu 14.04 server. The slc command does not work. It says
The program 'slc' is currently not installed. You can install it by typing:
sudo apt-get install heimdal-multidev
How can I get it to run the Strongloop CLI instead of looking for this package? I have added this to my PATH and it still doesn't work. Any ideas?
Other Strongloop commands, like sl-build work and strongloop is listed in npm list -g.
Ubuntu 14 with node.js 4.1.2
By default somehow slc is not created or not added to PATH.
I solved this problem by adding symlink:
sudo ln -s /usr/lib/node_modules/strongloop/bin/slc.js /usr/bin/slc
A soft link named slc should have been created at /usr/local/bin which will point to strongloop binary.
Please verify if the following exists.
/usr/local/lib/node_modules/strongloop/bin/slc
If no, then strongloop did not get installed successfully, otherwise verify the existence of the softlink slc at /usr/local/bin/.
/usr/local/bin/slc -> /usr/local/lib/node_modules/strongloop/bin/slc
If yes, then /usr/local/bin needs to be added to the $PATH, otherwise create the softlink and verify that /usr/local/binin $PATH.
Looks like the Node installation that optionally comes with a Digital Ocean Droplet installs to a different location that's not in $PATH. I'm pretty sure that was the issue. Anyways, I fixed it by spinning up a server without Node pre-installed and followed this guide. Just use npm install -g strongloop instead of strong-cli because the latter has been deprecated.
Ubuntu 14.04 with node.js 4.4.2 (LTS) :
The installation of strongloop was done without any errors but slc was not added to the PATH. I solved this problem by adding the symlink:
sudo ln -s /usr/local/lib/node_modules/strongloop/bin/slc.js /usr/bin/slc
Actually i am not sure my case matches with yours but i want to share my experience. i got the same message anyway.
I realized that i had changed prefix of global packets before. Then i checked prefix with the following command.
$ npm config get prefix
/home/myUser/.node_modules_global
Then i added the path to PATH variable (but .profile, .bash_profile files will be better) in active command line window and problem solved.

Express command not working in terminal

I am kind of new to node.js. I installed node fine and it works. I can run the node command in the terminal as well as the node package manager command(npm). Working on a Mac by the way. So I installed express globally with the following command:
sudo npm install -g express
After I was done installing it globally I installed it in a small folder where I am working on a project.
sudo install express
That gave me a node_modules folder inside of my site folder. After I was done that I went to install stylus using the express command and I got the error that express is not a command.
express -c stylus
Can anyone shed some light on this issue? I also tried to link the global express to the folder where I am working on the project using the following command:
sudo npm link express
The terminal said that this command ran, but I still cannot run the express command.
Thanks for asking questions on this one. I found that running express-generator instead of just express fixed the problem. The following code in the terminal worked.
sudo npm install -g express-generator
Thanks again,
If your express binary keeps doing nothing. Install node-legacy:
sudo apt-get install nodejs-legacy
on ubuntu 14.04 nodejs 0.10 express did not work on terminal, though
sudo apt-get install nodejs-legacy
made it to work.
I faced similar issue. I tried all the solutions mentioned here. However couldn't get my problem solved.
This happens when location of express and nodejs is not same.
Issue arises when Node is installed using homebrew.
Just use this command export PATH=/usr/local/share/npm/bin:$PATH
NOTE: replace path with the path of express.
Follow this link for help.
Make sure you have package.json & index.js files. And instaled express-generator with -g tag.
If still getting error use like ex:npx express --view=pug myapp --git
I fixed this on my mac by forcing my user to own /usr/local/lib and running the command to install express-generator globally:
sudo chown -R $USER /usr/local/lib
then:
npm install -g express-generator
After this you can go ahead and run your express commands:
express -h

Installation of roots doesn't work

I'm trying to install roots but it's not working. I'm running the command mentioned on the website:
curl roots.cx/get | sh
but I'm getting the following error:
\e[31m✘\e[0m \e[1mlooks like you need to install or update node.js.\e[0m
I do have node.js installed (v 0.8.16) and it can be run from the command line.
Any idea what the issue could be?
Looks like the install script is broken. You can just install roots via npm:
npm install roots -g

Resources