What should I write in the console so that gulp installs all the necessary packages? package.json and gulpfile.js already exist

 { "name": "myproj", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "devDependencies": { "browser-sync": "^2.18.8", "del": "^2.2.2", "gulp": "^3.9.1", "gulp-autoprefixer": "^3.1.1", "gulp-cache": "^0.4.5", "gulp-concat": "^2.6.1", "gulp-imagemin": "^3.1.1", "gulp-rename": "^1.2.2", "gulp-sass": "^3.1.0", "gulp-sourcemaps": "^2.4.1", "gulp-uglifyjs": "^0.6.2", "imagemin-pngquant": "^5.0.0" } } 

I watched the video lessons, everywhere they say that these two files are simply copied and then written npm up that is, update all the packages. Why not npm install ? When I enter npm up I get errors:

enter image description here

I am not good at understanding such errors, tell me what the problem is. and tell us what the differences devDependencies and dependencies when you need to write devDependencies packages and when in dependencies

    1 answer 1

    Himself gulp does not put anything. Installation of packages involved in npm .

    By your mistake.

    First, update nodejs and the npm package manager. The screenshot shows that they are far from the latest versions. Then you can try to do:

    npm cache clear

    And watch what will happen next.

    By devDependencies/dependencies difference.

    In devDependencies are packages that are required for development (for example, the same gulp ). These production packages are not needed, and therefore are written in this section.

    In dependencies , packages are written on which the application depends directly.

    Accordingly, in order to install the package, add it in dependencies put the key - --save :

     npm install <пакет> --save 

    To write to devDependencies , use --save-dev

     npm install <пакет> --save-dev 
    • "update nodejs and npm package manager". And what commands to write correctly for the update? - Karalahti
    • For windows , it seems the most adequate will be to download from the office. Site latest version and reinstall. Then, for version checking, enter node -v and npm -v respectively. - Alexander Igorevich
    • It helped, thank you, another small question, is it necessary to install the latest versions of sass packages, for example, and others - Karalahti
    • This is a matter of taste. Better, for starters, probably - yes. If there are any difficulties with versions, you can always put a package with the required version, for example: npm install gulp@3.9.1 - Alexander Igorevich
    • and how to put the next - to-last version in order to isolate errors with beta versions of packages, or beta versions are not counted as last - Karalahti