drbarzaga / walmart-mws

Walmart Marketplace SDK is a wrapper sdk around the Walmart Marketplace API to used this sdk you will need an developer account with the ClientId and ClientSecret keys.
MIT License
8 stars 4 forks source link

Installation Problems #13

Closed doverradio closed 2 years ago

doverradio commented 3 years ago

Hello, I have just tried to add walmart-mws to my node.js project and ran the following command in the same folder as package.json:

npm install walmart-mws

After, I started up the project and immediately got this error:

Error: Cannot find module 'C:\Users\backend\node_modules\walmart-mws\src\walmart-mws.js'. Please verify that the package.json has a valid "main" entry
    at tryPackage (internal/modules/cjs/loader.js:320:19)
    at Function.Module._findPath (internal/modules/cjs/loader.js:533:18)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:875:27)
    at Function.Module._load (internal/modules/cjs/loader.js:745:27)
    at Module.require (internal/modules/cjs/loader.js:961:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (C:\Users\backend\controllers\walmart.js:3:18)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at Module.require (internal/modules/cjs/loader.js:961:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (C:\Users\backend\routes\walmart.js:14:5)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10) {
  code: 'MODULE_NOT_FOUND',
  path: 'C:\\Users\\backend\\node_modules\\walmart-mws\\package.json',
  requestPath: 'walmart-mws'
}

Was there something else I was supposed to do to avoid this error?

pedrohma commented 3 years ago

Hey, @doverradio try to import it as:

const walmart_mws = require("../node_modules/walmart-mws/src/walmart-msw")

Please let me know if that works for you 👍🏼

doverradio commented 2 years ago

I created the public and private keys but now I don't know what to put for these values:

    'VERSION', 
    'NAME',
    'PRO_ENV' // optional, default is ''

What is VERSION and NAME? Should I omit PRO_ENV?