I recently downloaded a package from Github at the following link: list.fuzzysearch.js. After unzipping it to a folder, I proceeded to install it in my project directory using the command:
npm install Path/to/LocalFolder/list.fuzzysearch.js-master -S
However, I encountered an error during the bundling process with webpack, indicating that some required modules were missing.
Question 1: Should I first run npm install
in the downloaded package's folder before installing it in my project, for example:
~/local/folder/list.fuzzysearch.js-master$ npm install
Question 2: When importing a module in my app.js, how should I specify the path? Should I simply use the module name (e.g. 'react'), or should I provide the path to the JS file in the node_modules folder (e.g. 'node_module/react/dist/react.js')?
Question 3: Is there a method to uncover all transitive dependencies of a module and install them automatically?
Errors:
ERROR in ./~/list.fuzzysearch.js/index.js
Module not found: Error: Cannot resolve module 'classes' in /home/mypc/IdeaProject/OpenDimSum/frontend/node_modules/list.fuzzysearch.js
@ ./~/list.fuzzysearch.js/index.js 1:14-32
ERROR in ./~/list.fuzzysearch.js/index.js
Module not found: Error: Cannot resolve module 'extend' in /home/mypc/IdeaProject/OpenDimSum/frontend/node_modules/list.fuzzysearch.js
@ ./~/list.fuzzysearch.js/index.js 3:13-30
ERROR in ./~/list.fuzzysearch.js/index.js
Module not found: Error: Cannot resolve module 'to-string' in /home/mypc/IdeaProject/OpenDimSum/frontend/node_modules/list.fuzzysearch.js
@ ./~/list.fuzzysearch.js/index.js 4:15-35
ERROR in ./~/list.fuzzysearch.js/index.js
Module not found: Error: Cannot resolve module 'get-by-class' in /home/mypc/IdeaProject/OpenDimSum/frontend/node_modules/list.fuzzysearch.js
@ ./~/list.fuzzysearch.js/index.js 5:17-40
My app's JavaScript code:
require('../../../node_modules/bootstrap/dist/css/bootstrap.css')
require ('../public/styles.css')
require ('../index.html')
import React from 'react'
import {render} from 'react-dom'
import 'list.js'
import 'list.fuzzysearch.js'
require('../../../node_modules/bootstrap/dist/js/bootstrap')