Closed icq4ever closed 6 years ago
Good afternoon @icq4ever and thank you for your interest in improving this package.
I understand you are having trouble instantiating a YTSearcher object. While most likely unrelated to the current issue, the latest release version of 1.1.3 contains various bug fixes and improvements from previous versions, so please make sure you are up-to-date.
That said, I've determined that you are incorrectly importing the YTSearcher object itself. If you check the docs/Readme or requiring the package in a repl, you'll note that ytsearcher exports several items. You must use a destructuring assignment when importing the YTSearcher object.
In short, you cannot assign the exports directly to YTSearcher
and call new
on it. As quoted from README.md, you must use:
Creating the object: const { YTSearcher } = require('ytsearcher');
and then create a new object with new YTSearcher({
etc.
You can also assign YTSearcher with YTSearcher = require('ytsearcher').YTSearcher;
Thank you for your time, and if you have any other questions feel free to let me know. Have a good day.
~ William
Issue #1 Marked as Closed Wed July 31 Do you enjoy using this package? If so, consider leaving a star on this repository, and checking out my other work, including my latest release easypathutil! Have an improvement you want to contribute? If so, please consider creating a pull request! Thank you for your time opening this issue, I hope you found my support useful, and if you have any other questions feel free to let me know.
writing codes on index.js in this repository, works. but with npm install, cannot initilize new ytsearcher object with new keyword.
error log
simple app.js