I'm trying to get parameters from a URL, for example:
http://localhost:8888/?name=test
To get name parameter I saw some samples where they use the url module like this:
var url = require('url');
var urlParts = url.parse(request.url, true);
var query = urlParts.query;
So, first I ran this command npm install url, also the dependency is on the package.json file, but I always get this error:
TypeError: Cannot call method 'parse' of undefined
at C:\Users\Administrator\git\test\app.js:28:7
Anyone has faced this problem before?
console.log(url);?