- After npm init
- If you work too often with gulp, best practice to duplicate the dependency of your existing package.json to new package.json completely, unless you need some specific dependencies for your project.
- npm i
- Else, if you've npm i earlier, remove the node_modules first and reinstall npm with
rm -rf node_modules
npm install
Example of package.json as follows:
{
"name": "creditpage",
"version": "1.0.0",
"description": "build for credit page",
"main": "main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Lc",
"license": "ISC",
"devDependencies": {
"autoprefixer": "^7.1.6",
"css-mqpacker": "^6.0.1",
"cssnano": "^3.10.0",
"gulp": "^3.9.1",
"gulp-concat": "^2.6.1",
"gulp-deporder": "^1.1.0",
"gulp-htmlclean": "^2.7.15",
"gulp-imagemin": "^3.4.0",
"gulp-newer": "^1.3.0",
"gulp-postcss": "^7.0.0",
"gulp-sass": "^3.1.0",
"gulp-strip-debug": "^1.1.0",
"gulp-uglify": "^3.0.0",
"postcss-assets": "^5.0.0"
},
"dependencies": {
"bootstrap": "^3.3.7",
"bootstrap-sass": "^3.3.7"
}
}