Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package usage issue on NodeJS #10

Open
Aineah-Simiyu opened this issue Jun 10, 2024 · 4 comments
Open

Package usage issue on NodeJS #10

Aineah-Simiyu opened this issue Jun 10, 2024 · 4 comments

Comments

@Aineah-Simiyu
Copy link

Aineah-Simiyu commented Jun 10, 2024

I am having issues importing the sdk for usage in that i am getting this error. i am using nodeJS v20.x, npm 10.5, i will greatly appreceate a nudge on this. Thanks alot.
My env : {
"intasend-node": "^1.1.0",
}

` Error: Cannot find module '/Users/*****/VisualStudioCodeProjects/paysplit/node_modules/intasend-node/dist/intasend.js'. Please verify that the package.json has a valid "main" entry

code: 'MODULE_NOT_FOUND',
path: '/Users/*****/VisualStudioCodeProjects/paysplit/node_modules/intasend-node/package.json',
requestPath: 'intasend-node'

code example

const IntaSend = require('intasend-node');
require('dotenv').config({path : "./../.env"})

class IntaSendService {
constructor(publishableKey, secretKey, isTest) {
this.intasend = new IntaSend(publishableKey, secretKey, isTest);
this.collection = this.intasend.collection();
}

mpesaStkPush(data) {
	return this.collection.mpesaStkPush(data)
	.then((resp) => {
		console.log('STK Push Resp:', resp);
		return resp;
	})
	.catch((err) => {
		console.error('STK Push Resp error:', err);
		throw err;
	});
	}

}

module.exports = IntaSendService
`

@erickmoon
Copy link

Same issue

@okjodom
Copy link

okjodom commented Aug 21, 2024

looks like this was closed with v1.1.1, please confirm and close

@okjodom
Copy link

okjodom commented Aug 21, 2024

Actually, I confirmed this issue is still relevant. Seems fix to be executed by maintainer is:

  • patch version in package.json from v1.1.1 to v1.1.2
  • run yarn build - this bundles and created type files in /dist
  • confirm /dist directory has both *.js, *.d.ts and *.d.ts.map files
  • publish new version

@mugendi-gitonga
Copy link
Collaborator

I have resolved this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants