I am very new to node.js, npm and JavaScript but for code coverage trying with Istanbul tool and hence installed nyc
with npm i nyc
referring to https://www.npmjs.com/package/nyc which outputs like
C:\Users\user>npm i nyc
npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\user\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\user\package.json'
npm WARN user No description
npm WARN user No repository field.
npm WARN user No README data
npm WARN user No license field.
+ nyc@15.1.0
updated 1 package in 1.334s
9 packages are looking for funding
run `npm fund` for details
But when I hit nyc
o command prompt, it says - nyc is not recognized as internal or external command.
As per doc, I added dev dependency with following but seeing same error.
C:\Users\user>npm i -D nyc
npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\user\package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\user\package.json'
npm WARN user No description
npm WARN user No repository field.
npm WARN user No README data
npm WARN user No license field.
+ nyc@15.1.0
added 142 packages from 99 contributors in 48.325s
9 packages are looking for funding
run `npm fund` for details
Please guide me what is wrong here.