既存の環境からpackage.jsonを作成する
ターミナルで既存環境の配下に移動し、npm initを実行する
1 |
npm init |
下記のような質問が次々表示されるのでエンターしていく
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
package name: (package) version: (1.0.0) description: git repository: keywords: author: license: (ISC) About to write to /path/package.json: { "name": "package", "version": "1.0.0", "main": "gulpfile.js", "dependencies": { "browser-sync": "^2.26.3", "gulp": "^3.9.1", "gulp-autoprefixer": "^6.1.0", "gulp-plumber": "^1.2.1", "gulp-sass": "^4.0.2" }, "devDependencies": {}, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "description": "" } Is this OK? (yes) |
最後の「Is this OK? (yes)」でえんたーすると、package.json が作成されている。
package.json
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
{ "name": "package", "version": "1.0.0", "main": "gulpfile.js", "dependencies": { "browser-sync": "^2.26.3", "gulp": "^3.9.1", "gulp-autoprefixer": "^6.1.0", "gulp-plumber": "^1.2.1", "gulp-sass": "^4.0.2" }, "devDependencies": {}, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "description": "" } |