JasonGenX
JasonGenX

Reputation: 5434

GRUNT installs without package.json

npm install -g grunt-cli
npm install --save-dev grunt grunt-contrib-concat grunt-contrib-uglify grunt-sass grunt-contrib-less grunt-contrib-watch

But no package.json is ever created in the folder where I ran those commands.

When I run grunt from command line:

>> Error: Unable to read "package.json" file (Error code: ENOENT).

What am I doing wrong?

Upvotes: 0

Views: 811

Answers (1)

zzzzBov
zzzzBov

Reputation: 179046

When I run grunt from command line:

>> Error: Unable to read "package.json" file (Error code: ENOENT).

None of the commands you ran would have created a package.json file, so unless you manually created a file named "package.json" including an empty JSON object ({}), it makes sense that the commands would fail to save the dependencies in the package.json file.

If you run npm init from command line, it'll create a package.json file with basic settings.

Upvotes: 3

Related Questions