Node npm global install of express cloud9 - node.js

I am trying to install express globally in cloud 9 IDE. I run the following command -
npm install -g express
then on the bash prompt I enter -
express --version
I get unknown command error?
Can I not install stuff globally on cloud 9 ?
Niladri

You need to add environment variables to achieve that in windows some times. May be you can try that there.

Related

loopback "lb4" command is not working after successfully installation of loopback CLI using "npm i -g #loopback/cli"

I have successfully installed loopback CLI using npm i -g #loopback/cli after that I'm trying to create app using lb4 app command terminal and it shows me Command 'lb4' not found.
Only lb app works for version 3 and 2 but I want to create application compatible with loopback version 4.
I had the same problem and solved it by updating to the latest version of Node.js (10.7 as of now). Then I reinstalled the LoopBack CLI with npm i -g #loopback/cli and the lb4 app command worked just fine. Also, I was executing all the commands as admin, in case it helps.
If you're having trouble creating a global link on Windows 10 (like I did).
Consider installing in the NodeJS project folder as a work-around.
Simply execute:
npm install #looback/cli --no-save
Notes:
This will install the cli without listing it as a dependency in your package.json.
This will allow you to run lb4 app only in the root folder of project where you ran the command.
This solution is not ideal since you'll have to do this for each project. However I figured it beats having to install a new version of NodeJS just for the installer to clear some cache/configuration that got messed up over a long time-period.
Upgrade your Node.JS to version 8.9 or higher.
It's a Prerequisites.
See the doc: https://loopback.io/doc/en/lb4/Getting-started.html#prerequisites
Also some time npm installs the JS module successfully but does not add in environment variable. Find the npm folder path (in my case C:\Users\user_name\AppData\Roaming\npm) and add into class path. After adding environment variable restart the command prompt.
I was also facing same problem. But then I ran the command using sudo and it worked. sudo npm i -g #loopback/cli.
sudo update-alternatives --install /usr/bin/lb4 lb4 /opt/nodejs/node-v19.1.0/bin/lb4 0
This command will be more useful to solve this problem.
You can replace nodejs path according to your system.(/opt/nodejs/node-v19.1.0/bin)

Installing Angular CLI with npm install fails

I am new to AngularJS, just started an online course.
I am trying to install angular CLI on my computer at work running Windows 7.
I opened command line as administrator and running npm install -g #angular/cli. Installation starts and after a few minutes I get an error:
I see the notification "operation not permitted", but I am the administrator of the computer and the command line I run as administrator.
What am I doing wrong?
The same installation I did on my laptop at home and it was successful.
I am checking with our IT support about other possible causes and will appreciate any help.
This is not a duplicate of Fail to install npm package “npm ERR! errno -4048” or npm install -g angular-cli fails.
Ignoring the error and running gn -v I get the following:
Is this correct? Was Angular CLI installed?
These issues are because of the company proxy settings.
Check with your admin to get the proxy for http or https.
It will be something like this:
http_proxy = http://http.myproxy.com:8000
https_proxy = http://http.myproxy.com:8000
Replace myproxy with the name of company proxy.
Then go to the command prompt and run the following command to set the proxy. Later you can run any command like npm install -g #angular/cli to run. It will work
npm config set proxy http://http.myproxy.com:8000
npm config set https-proxy http://http.myproxy.com:8000
That fsevents library has peculiarities on Windows. So I suggest you ignore the error message and run ng -v from the command prompt to confirm you got the Angular CLI libraries installed.
You need to run the npm commands on node.js command prompt but not on windows command line.
Workaround: install git bash on windows.
As the error message suggest, you don't have some permissions to execute your command.
Depending on your system, you should run the command as an administrator.
Also, don't mix AngularJS (the first Angular framework) and Angular (also known as Angular 2, 4 and 5 now) . They are radically different in their syntax and uses.
Run below command and try installing angular cli again.
npm cache clean -f
This worked for me manytimes.

Install express-generator without global attribute

I am working on a VPS through Dreamhost and they do not allow the use of sudo so I can not install express-generator globally. I really like all the files that express initiates when calling the express command. Is there a way to install express-generator without the global attribute or a way to get all the files that the command express initializes?
Remember when you npm install x then there's always the option of running whatever it installed via node_modules/x/bin/x if that's the name of the shell command it installs.

Express is not working on ubuntu

I have installed nodejs,express on ubuntu but when i type "express test" command on terminal on ubuntu, its not creating the folders etc (package.json,app.js, view folder ect).It simply prompts in the next line.
Please help
If you want to generate the scaffolding for a new express app you can use the express-generator.
First you need to install the needed module globaly.
sudo npm install express-generator -g
Then you can use this command to generate your scaffolding.
express <my_app>
More info here http://expressjs.com/starter/generator.html

AngularJS testing using Karma

I am very new to AngularJS and trying to test a piece of functionality using Karma.
I installed node.js and when I open it and enter the following it doesn't do anything.
$ npm install -g karma
Please anyone can help me how can I achieve this.
I ran into a similar issue. I believe I wrote a fairly complete blob post about how to Setup AngularJS, Angular Seed, Node.js and Karma. This post describes how to install Karma on a windows computer using the command prompt.
http://bardevblog.wordpress.com/2013/07/28/setting-up-angularjs-angular-seed-node-js-and-karma/
On Windows, you can install Karma from the Command Prompt. Do not install it from within Node.js.
Steps to install Karma
1.install nodejs from https://nodejs.org/download/ site appropriate for your system
2.open command prompt and traverse to your project path 'C:\project folder\'
3.type and run this in command prompt ->npm install karma --save-dev
4.type and run this in command prompt ->npm install -g karma-cli

Resources