Node is not getting installed and it is showing error - node.js

I was installing node by using the command on cmd npm install and I got following message
enter image description here
Please help me that how I can solve this issue.

npm stands for node package manager which is used to install external packages or npm modules or libraries hosted on NPM. To get started with a Node JS Project you will need index.js and hit npm init, this will initialise your Node JS Project with auto genreated package.json.
Majorly Node JS, React JS or Angular contains following files:
index.js/server.js(Entry File)
package.json (modules/packages/libraries used in project and script can be written to run your project in different envs)
node_modules (which is auto generated and contains all installed modules listed in package.json)

According to your error message you don't have a package.json file so you need to initialize npm before installing node in your directory.
Initialize it with npm init.
Npm documentation

Step 1- First install Node from https://nodejs.org/en/download/.
Step 2- Now go to your project file cd project.
Step 3- Type the command npm init in console.
Step 5- Now you can see package.json file in your project.
Finish- Now you can install any package by using "npm install packageName" command.

Related

Why is "npm install" looking for a file that doesn't exist (package.json) on a fresh NodeJS installation?

Hello, World!
I am having trouble getting NPM working.
First, I installed node.js from https://nodejs.org/en/download/ (the 64-bit .msi, on Windows 10, Version 10.0.18362 Build 18362). Node -v is 12.16.3.
Using Powershell, I navigated to the nodejs directory created in the install. Then I attempted npm install, which ultimately drew a series of errors beginning with "ENOENT: no such file or directory, open '...\nodejs\package.json' ".
The nodejs directory contains a file called "package-lock.json", but no "package.json".
Renaming the "-lock" file did not fix the error.
I've read on this site that Node came with NPM pre-installed. I can run npm -v without a problem ("6.14.4" returned) but trying npm start gives me the same error as npm install (cannot find package.json).
I have uninstalled Node & reinstalled twice, same problem.
Thoughts?
You should create a package.json file for every project using npm libraries, whether or not you are going to publish your code anywhere.
The easiest way is to run npm init and answer the questions, then npm will create the package.json file.
(Or take a look at the docs for other ways to run init, like npm init -y to just generate a plain package.json that you can manually edit.)
BTW, package-lock.json is a different kind of file that's generated to say which versions of each transitive dependency were installed. It doesn't have the same format as package.json; don't mix them.

How to get Started with Ember on windows using npm?

C:\Users\andri>cd ember-cli
Das System kann den angegebenen Pfad nicht finden.
C:\Users\andri>npm install -g bower
npm WARN deprecated bower#1.8.2: ...psst! Your project can stop working at any moment because its dependencies can change. Prevent this by migrating to Yarn: https://bower.io/blog/2017/how-to-migrate-away-from-bower/
C:\Users\andri\AppData\Roaming\npm\bower -> C:\Users\andri\AppData\Roaming\npm\node_modules\bower\bin\bower
+ bower#1.8.2
added 1 package in 23.177s
C:\Users\andri>ember new testapp-app
installing app
create .editorconfig
create .ember-cli
create .eslintrc.js
create .travis.yml
create .watchmanconfig
create README.md
create app\app.js
create app\components\.gitkeep
create app\controllers\.gitkeep
create app\helpers\.gitkeep
create app\index.html
create app\models\.gitkeep
create app\resolver.js
create app\router.js
create app\routes\.gitkeep
create app\styles\app.css
create app\templates\application.hbs
npm: Installed dependencies
Successfully initialized git.s
C:\Users\andri>ember server
node_modules appears empty, you may need to run `npm install`
C:\Users\andri>bower install
bower ENOENT No bower.json present
C:\Users\andri>ember server
node_modules appears empty, you may need to run `npm install`
I am trying to install ember and keep getting errors. Does anybody understand what I am doing wrong? I am watching a youtube tutorial and I follow the steps that are on the video, still it doesnt work, in fact I get totally different results :/ I have also installed git.. Could somebody explain to me what is happening here? I am very new to all these and therefore I cannot spot the mistakes. Thank you in advance
For Windows Users:::
Install Node js for windows and then install npm package for it and if you have done that.
You can install ember from npm.
Install Ember using npm:
npm install -g ember-cli#3.0
To verify that your installation was successful, run:
ember -v
If a version number is shown, you're ready to go.
see the link below for more details...
https://guides.emberjs.com/v3.0.0/getting-started/
looking your prompt, to start a ember server, just go to your ember app folder (cd\testapp-app) and use ember serve or ember s
Your last error there is telling you what's missing.
node_modules appears empty, you may need to run npm install
Running npm install in the project folder and then running ember server should get you up and running. The default URL is http://localhost:4200 when ember-cli has spun up the server.

How do i import a project using node.js npm install on a package.json?

I'm new to node.js and i have looked around about how to import a project from a package.json using node.js with command:
npm install "package name"
I have downloaded the project but i can't get it to work.
Where do i find the package name?
What should i type in order for it to work?
Run the command npm install (without any arguments) in the directory where the package.json file is located. That will install ALL packages listed in package.json into a node_modules folder in the same directory.
Side note: When you start developing the project further and want to install new dependencies you can run npm install somepackagename --save and that will install the package into node_modules as well as adding a line into the package.json file, specifying which name and version of the package that was installed.
The idea is that you can upload a project folder, without node_modules, and anyone can download your project and just run npm install to download all dependencies.

Include BItcoinJS library in electron project

I was wondering how to include the Bitcoin JS Library in my electron project. I tried running npm install inside the project directory and creating a var to use it but it does not work for some reason.
Do you have a package.json in your project directory? If so, does it have Bitcoin JS inside the dependencies:? If not, run npm init and fill out the fields that it asks for or just hit enter several time to leave them blank. After that you should have a package.json file. Now run npm install bitcoinjs-lib --save. You should now have BitcoinJS in your node_modules folder and it should be included as a dependency in your package.json.

Why after "npm install express" there is no package.json in my directory?

I am using latest version of nodejs, 0.10.24
I followed this tutorial: http://net.tutsplus.com/tutorials/javascript-ajax/how-to-scrape-web-pages-with-node-js-and-jquery/
after installing npm install express, I can't find the package.json file in the same directory.
But when I tried this on Windows a few months before, I noticed that there was a file in the same directory.
Is there anything I need to do to fix?
Thanks,
When you npm install module ,the only goal is to download and save the module in ./node_module/ directory.
If you want get a package.json, you must use npm init and fill all the information asked.
After that, you can make npm install module --save, that command will download and add the module in your package.json.

Resources