Reputation: 123178
I have a node module without a package.json
(which I'm trying to fix). The package uses cheerio
and superagent
:
var log = console.log.bind(console),
superagent = require('superagent'),
cheerio = require('cheerio');
These dependencies are pulled in from parent project or from global modules. How can I tell exactly what version of the package is being loaded?
Upvotes: 1
Views: 106
Reputation: 3342
just require the package.
var package = require('supertest/package.json');
console.log(package.version);
Upvotes: 2
Reputation: 562
npm list
for local packages or npm list -g
for globally installed packages.
The result should look like (package@version):
And you can know the version of package name directly by npm list <pacakage-name>
Upvotes: -1