1

I am using Browserify (http://browserify.org/) to load a module in JavaScript. I keep getting the following error:

error

I have no idea why this is happening. I have a "package.json" file in a directory called "wordnet-develop", which is located in the same location as the JavaScript file.

Originally I thought that there might be a path problem. However, I did the same exact thing but with a test.js file, and it worked. So, I think that there may be something wrong with using package.json.

The beginning of the package.json file:

package.json

The beginning of my JavaScript file:

popup.js

The directory containing the javascript file: directory 1

The directory (seen above as "wordnet-develop")containing the package.json file: directory 2

UPDATE

I replaced var WordNet = require('./wordnet-develop/node-wordnet'); with var WordNet = require('./wordnet-develop/lib/wordnet'); as suggested by klugjo.

It may have worked, but now I am getting a new error message:

another error :(

This happened again but with 'async' module missing. I checked lib/wordnet, and it included requirements for bluebird and async, so that's probably the error source.

However, I now have no idea what to do. I'm new to node.js and modules, so I'm unfamiliar with solutions. Am I supposed to parse all of the code and find all the required modules online? Shouldn't they have been included in the module? Is the problem that I'm trying to use a node.js module in vanilla JavaScript?

1 Answer 1

1

I don't think what you are trying to do is supported: you have to link directly to the entry javascript file of the node-wordnet library.

Replace

var WordNet = require('./wordnet-develop/node-wordnet');

With

var WordNet = require('./wordnet-develop/lib/wordnet');
Sign up to request clarification or add additional context in comments.

2 Comments

I tried that, but it didn't exactly work. See above for the details.
Do you have all your dependencies in ? Go to the wordnet-develop folder and run npm install

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.