npm init not creating package.json on mac
See https://www.npmjs.com/package/npm-autoinit
1 | $ npm ls |
I often use temporary directories to play/experiment with packages and hustling with package.json every time I want to check out some package is not an option for me.
This module will make npm run
1 | npm init --yes |
automatically for you if it sees fit.
See https://github.com/npm/npm/issues/9161
备注:在对应的文件夹下运行
1 | npm init --yes |
See http://stackoverflow.com/questions/21982785/npm-init-not-creating-package-json-on-my-mac
Try this.
Go to terminal.
Change directory location where you want to create a file.
1
cd your_destination_folder
Type npm init and press enter.
It ask for name, version, description, entry point, test command, git repository, keywords, author, license. Pass those values.
Then it prompt, Is this ok? (yes). Enter yes.
Hurray, your package.json file is created.