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

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

Related

i am getting this error even after executing this command "npm install express-hbs --save"

Hey guys I am getting error even after executing the above command if there is any other command to resolve this error please let me know
Error: Cannot find module 'express-hbs'
Before You start using the package - express-hbs, You must install it properly, most likely You installed the package in the wrong place, outside of the project folder.
In the root project folder, run the command:
npm install express-hbs
try again to run nodemon

katacoda command not found

I'm trying to install the katacoda client. I used NPM to install it:
npm install -g katacoda-cli
The installation was successful but when I'm trying to run the katacoda help I've got the following error: command not found: katacoda. NPM installed katacoda here: /usr/local/Cellar/node/10.7.0/lib/node_modules/katacoda-cli. If I run the following: /usr/local/Cellar/node/10.7.0/lib/node_modules/katacoda-cli/bin/run help katacoda is executed correctly. I guess my problem is coming from my $PATH, which is set like this: export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
You can go to one of the directories, say /usr/local/bin, and then run ln -s /usr/local/Cellar/node/10.7.0/lib/node_modules/katacoda-cli/bin/run katacoda. Then you should be able to run katacoda directly. If you don't have permissions to do so in /usr/local/bin, choose another directory where you have permissions, do the same and add the directory to your $PATH

Cannot run appcenter CLI after successful install

I just installed appcenter CLI on my MacBook following this guide:
https://learn.microsoft.com/en-us/appcenter/cli/
When trying to run the commands from Terminal, e.g. appcenter login I get the following error:
-bash: appcenter: command not found
I quit all my terminal processes and startet one again, but no luck either. Do I need to export some sort of path for it to work?
I had similar issue and installing it globally worked
npm install -g appcenter-cli
Try to install appcenter-cli globally
yarn global add appcenter-cli
or using npm
npm install -g appcenter-cli
Anvesh from Appcenter pointed me to this link:
-bash: react-native: command not found
While it is not for appcenter per se, it solved my problem by adding the correct path.
I was also facing the same issue ,After running the installation cmd for appcenter-cli on successfully and when I have tried to check appcenter version using appcenter -v cmd on normal command prompt.. it gives me same error: appcenter: command not found
later on when i have tried to run same cmd on node.js command prompt then it able to fetch appcenter details...

Node command not found

I'm trying to install avrgirl-arduino using the command sudo npm install avrgirl-arduino. When I try running the command avrgirl-arduino list I get an error saying -bash: avrgirl-arduino: command not found. I ran npm init before running the first command and it still doesn't work.
You may want to install your package globally :
npm install -g avrgirl-arduino
This way you can use command line tool package (like grunt)

Cannot get "npm install -g" to work on any packages (AppData/Roaming/npm always empty)

Running nodejs on Windows 7 Enterprise at work.
Whenever I install a node_module that needs -g access, from experience I know it's supposed to create a *.bat file in %AppData$/Roaming/npm, but for some reason it no longer does that.
For example, I will run npm install gulp -g, console looks like it installed correctly, but the files will not be in the AppData folder. And if I try running a gulp command, I get error sh.exe": gulp: command not found.
If I run the npm install gulp -g command in Console As Administrator, it installs the files into the %AppData% folder of the administrator (instead of the regular user). So if I run the gulp command through my non-administrator user, I still get error sh.exe": gulp: command not found.
Any ideas?
Found solution:
(1) Upon running the command: npm config get prefix, output is C:\Program Files (x86)\Git\local. No idea why it was set to this, as it's not the default.
But I changed it using: npm config set prefix "$APPDATA\npm".
Now when I install a --g module, ie. npm install gulp -g, it installs into this desirable directory, no longer throwing EPERM and ENOENT errors.
(2) Still need to add a PATH entry for the npm folder. The command export PATH=$PATH:/c/Users/{YOUR_USERNAME}/AppData/Roaming/npm works temporarily, but if you close console and open it again, might not be saved (if you are not an administrator).
But you can also use echo 'export PATH=$PATH:/c/Users/{YOUR_USERNAME}/AppData/Roaming/npm' >> ~/.bash_profile, which will create a .bash_profile file, which is run each time as your console is opened. So from this point, it should automatically add the required PATH entry.
I also faced this same issue.
After installing node.js(https://nodejs.org/en/download/) npm folder(in appdata folder) remain empty.
so, at this stage if you try to build/run angular project(ng build/ng serve), it will give error as:
The term 'ng' is not recognized as the name of a cmdlet, function, script file, or operable program.
So, for fixing this issue install angular globally in your project with following command:
npm install -g #angular/cli
Now, there would be data in npm folder(node modules etc.) and ng command will run now.

Resources