error install express

0

I have this problem, every time I try to install express in windows 10 with the command npm install express or npm install express-generator I get this error:

 npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\PC\Documents\proyectos_practica\node_practice\package.json'
npm WARN node_practice No description
npm WARN node_practice No repository field.
npm WARN node_practice No README data
npm WARN node_practice No license field.

I have already added the variables to the path, does anyone know what it can be? thanks in advance

    
asked by brian lorenz 25.05.2017 в 15:08
source

4 answers

1

Do you have the Package.json created with the dependencies that you are going to use, inside the project folder?

The standard is defined in: Package.json

So, instead of installing all the libraries one by one, you just have to use:

    npm install

In addition, as you have indicated the companion Vicente Almea you can also install libraries globally, adding to the command -g , for example:

    npm install -g nodemon

I hope I have been helpful. Greetings!

    
answered by 25.05.2017 в 15:29
1

really if I think you should have package.json to install something with npm , I suggest that before starting any project use npm init , then you can easily install any module using npm install . I hope it helps you.

    
answered by 05.06.2017 в 20:05
1

The problem is because you do not have a package.json in the project, to install express with express-generator you have to install it global first:

npm install --global express-generator

then you can use the express command to create an express project, which creates an application with package.json and what you need to start, you just have to install the missing dependencies with npm install , and then npm start to run the application

    
answered by 05.06.2017 в 20:12
0

You have to install it global:

nmp install -g express-generator
    
answered by 25.05.2017 в 15:15