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

Update package name #541

Closed
wants to merge 2 commits into from
Closed

Update package name #541

wants to merge 2 commits into from

Conversation

g0ddish
Copy link

@g0ddish g0ddish commented May 10, 2018

This throw errors in newer versions of NPM(not having a name)

This throw errors in newer versions of NPM(not having a name)
@sonnyp
Copy link
Member

sonnyp commented May 10, 2018

Thanks, comma missing, can you tell me for what operation(s) npm is failling?

@g0ddish
Copy link
Author

g0ddish commented May 15, 2018

Comma is fixed, I actually couldn't install the package via npm due to this. Npm is node package manager?

@sonnyp
Copy link
Member

sonnyp commented May 15, 2018

npm install in the git repository works fine, I don't understand what is this fixing. (npm v6.0.1)

Maybe this is what you're looking for https://github.com/xmppjs/xmpp.js/tree/master/packages/xmpp.js

@g0ddish
Copy link
Author

g0ddish commented May 15, 2018

Installing the deps of xmpp.js works fine, installing xmpp.js via npm works at the tag. The current master branch doesn't install via npm

npm install  https://github.com/xmppjs/xmpp.js
npm ERR! Can't install git+https://github.com/xmppjs/xmpp.js.git#cb60ef33db6a7bb9c5830c606cae6aa626d19681: Missing package name

My branch

npm install  https://github.com/g0ddish/xmpp.js
npm ERR! Can't install git+https://github.com/g0ddish/xmpp.js.git#6262644970e056b6de12044c6e17fc2a26533c6a: Missing package version

It still throws errors about package version etc this doesn't solve all of these problems.

@sonnyp
Copy link
Member

sonnyp commented May 15, 2018

the root of the xmpp.js repository isn't a "valid" npm/node module so even with the name field you wouldn't be able to use it (see lerna)

And npm/yarn don't allow to use subdirectories in git urls.

npm/npm#2974
yarnpkg/yarn#4725

If you want to use the repository, the only way is

git clone git@github.com:xmppjs/xmpp.js.git
cd xmpp.js
make

and then

const client = require('./xmpp.js/packages/client')

@soulfly
Copy link

soulfly commented Jul 16, 2018

@sonnyp could you please add this info on how to install the lib somewhere in the main README file

@soulfly
Copy link

soulfly commented Jul 16, 2018

Just to note here, for future searchers,

This doc http://xmppjs.org/client/ is not up to date

The following code

const Client = require('./xmpp.js/packages/client').Client
var client = new Client()

will not work properly, the client.handle('authenticate', ...) will never be called because we use here a 'pure' Client, without proper setup of routers, auth mechanizms and so on

What we need to do is the following:

var client = require('./xmpp.js/packages/client').xmpp().client;

and we will get a proper set up client

got this info from src code https://github.com/xmppjs/xmpp.js/blob/master/packages/client/index.js#L29

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

Successfully merging this pull request may close these issues.

3 participants