NodeJS command line does not recognise 'install' - node.js

screenshot of nodeJs command line
My node.js command line says 'install' is not recognised as an internal/external command when I try to update it, according to the installation instructions from a third party website.
Do I need to worry about updating node.js? I am about to embark on an exercise and want to ensure the programme is running correctly.
Thanks in advance.

If you are trying to install a package from npm then you need to use
npm install <package> [options] .
and not node install.

Related

Something's wrong when i create a new project vue

I am starting to learn vuejs and I have a problem while creating a vue project with terminal. As you can see in the picture, the loadDep status line keeps spinning without moving. Can someone help me solve this problem T.T
enter image description here
As I can not see which command you have fired for installation in your image.
Please checkout the official Document's Installation Page for more In Depth Installation Information.
https://v2.vuejs.org/v2/guide/installation.html
Use VueCLI for Command Line Installation.
If you are installing Vuejs using the terminal you need to:
Firstly install NPM package manager.
Then run the command below to install VueCLI:
npm install -g #vue/cli #vue/cli-service-global
After executing this command simply check if it works successfully by typing:
vue -v
It should print the vue version if it was successful.
Then you can create a Vue project by using following command:
vue create [Your Project Name]
It is all provided on VueCLI Site.

I can't create a workspace with 'ng new myworkspace' command in Angular7. What could be the cause

When I execute this:
ng new myapp
It generates the following error below:
This is my Angular version and it's my first installation:
I initially installed nodejs standalone but had to uninstall it when I wanted to install nvm-windows based on the installation instructions, which didn't work after so much trouble trying to get it to work. And at the end, I had to install 'nodist'. I have the feeling that the problem is from nodejs, it's not properly configured.
Please I desperately need your help, guys.
Thanks in advance!
remove node module and Uninstall the node
reinstall the application angular.io with globally
npm install -g #angular/cli
Try theses two options if you didn't :
- Run the ng new myapp in cmd.exe (not Git Bash)
- Try a fresh install of Node, Npm and #angular/cli
I hope it will help !
Thank you guys for the help. I really appreciate it. I have been able to solve the problem. The problem was with the ComSpec in the PATH variable. It had more than one value. It was supposed to have one and a specific value, i.e, C:\windows\system32\cmd.exe at all times. After setting it to a single value, I ran npm -v in my command line, another error showed up, and I then closed and ran npm -vcommand on my cmd as Admin and the problem was solved.
So, if anyone is installing nodejs on windows and encounters this kind of error:
'CALL "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nodejs\\node_modules \npm\bin\npm-cli.js" prefix -g' is not recognized as an internal or external com mand, operable program or batch file. 6.4.1
the tweak up there could be the solution.

What is the 'npm' command and how can I use it?

What is npm?
Whenever I browse through some project they ask me to run npm command, something like this
npm install -g node-windows
I went through some blog posts to learn about npm and I installed Node.js. However, when I run the above code in Node.js, I get the following errors:
When I browsed further, I came to know that the windows user can run the command from the cmd prompt window, but when I do that I get some output like this:
Which just generate a text file nothing else.
My questions:
How can I get started with the AngularJS2?
How can I run an npm command?
Do I require a command prompt to run the npm command (in Windows), or I can just use Node.js?
When I use the command npm install in my command prompt, I get the following output:
How to get started with the angularJS2
Follow this link and set up the project by following instructions
How to run a npm command
npm stands for Node Package Manager, and therefore you need Node.js installed before you can run npm commands.
Follow this and install the latest version. And restart the command prompt.
Do I require a command prompt to run npm commands (in Windows), or can I just use Node.js?
Yes, you need to run npm commands from the command line (in Windows).
E.g., npm install
You get the warning because there is no package.json file present where you are running the command.
ENOENT stands for Error NO ENTrey
Navigate to the project folder using the following command and then run npm install
cd <projectpath>
The AngularJS 2 website has everything you need to be covered. Their quickstart guide alongside with the quickseed zip file helps a lot.
But, in case you missed some points:
yes, you will need npm/NodeJS. So, download the latest distribution and have a clean installation of it.
you can execute the npm command with its parameters from within the Windows cmd.
the quickseed ZIP file contains all the files you need to see a live and quick example running locally. Unzip it on your workplace and navigate to it using the windows cmd. When inside the root folder of the unzipped package, execute npm install and right after it npm start.
Take the learning path. Step by step, all your questions will be answered.
You need to use an admin prompt for global installation (-g).

npm.cmd closes instantly after few seconds

I'm learning nodeJs. I managed to run nodejs commands on cmd and it works fine. Now I want to install express framework and for that in the tutorial I'm following it asks to type sudo install -g express on npm command prompt. So I typed npm in my windows search, and clicked on it. Right after few seconds less than 3 it closes straight away.
I found that npm.cmd exist in nodejs directory where node.exe found. What could be the problem here. If I were to type the above mentioned command in windows cmd, it says sudo is unrecognized program.SO must I use npm cmd?
After running cmd.exe , I guess you would have node installed but still run node -v , it should respond with the version meaning it's working.
Now if you want to explicitly install express.js you just have to run on, the command prompt itself,
npm install express -g.
Anyways you can follow this link from their official website. Hope it helps. Also sudo is a program for Unix like operating systems, just in case you needed it.

The directory to use npm to install package

I just get started on nodejs. I have installed nodejs and npm. Now, I want to install some packages like mongodb and express. As my default directory path in cmd is C:\>Users\administrator, do I need to make current folder as nodejs folder to run npm install express/coffee-script or I can just run this command under the default directory path mentioned above?
By the way, I always see the npm install command provided by others starts with a dollar sign, but I can only use the command without the dollar sign. So what does the dollar sign stand for?
By default, npm will run in local mode, and install scripts into ./node_modules. This is great if you need to require your scripts, as you'll do with Express.
Calling it with the -g option installs it globally, wherever node is installed (usually, on Linux, in /usr/local. This is great for packages that are meant to be run using the shell (for example, Supervisor).
Generally, if you want to develop a node.js application under C:\foo\bar\myapp, you will run npm from there.
FYI, the $ sign is a general indication meaning that the following command is meant to be run on the command line.

Resources