xmppjs / xmpp.js

XMPP for JavaScript
ISC License
2.18k stars 372 forks source link

xmpp.js build doesn't work #911

Closed netmikey closed 2 years ago

netmikey commented 2 years ago

Describe the bug After a fresh git clone, make fails. I haven't found further build instructions / requirements, so it might be me missing something here(?)

Logs

% make
node packages/xmpp.js/script.js
npm install
npm WARN deprecated iltorb@2.4.5: The zlib module provides APIs for brotli compression/decompression starting with Node.js v10.16.0, please use it over iltorb
npm WARN deprecated core-js@2.6.12: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported

> iltorb@2.4.5 install /Users/myself/projects/xmpp.js/node_modules/iltorb
> node ./scripts/install.js || node-gyp rebuild

info looking for cached prebuild @ /Users/myself/.npm/_prebuilds/99b967-iltorb-v2.4.5-node-v72-darwin-x64.tar.gz
info found cached prebuild 
info unpacking @ /Users/myself/.npm/_prebuilds/99b967-iltorb-v2.4.5-node-v72-darwin-x64.tar.gz
info unpack resolved to /Users/myself/projects/xmpp.js/node_modules/iltorb/build/bindings/iltorb.node
info unpack required /Users/myself/projects/xmpp.js/node_modules/iltorb/build/bindings/iltorb.node successfully
info install Successfully installed iltorb binary!

> core-js@2.6.12 postinstall /Users/myself/projects/xmpp.js/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

> undefined prepare /Users/myself/projects/xmpp.js
> husky install

husky - Git hooks installed
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN notsup Unsupported engine for @ava/babel@2.0.0: wanted: {"node":">=12.22 <13 || >=14.16 <15 || >=16"} (current: {"node":"12.18.3","npm":"6.14.5"})
npm WARN notsup Not compatible with your version of node/npm: @ava/babel@2.0.0

added 1440 packages from 907 contributors and audited 1444 packages in 50.297s

131 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

./node_modules/.bin/lerna bootstrap
lerna notice cli v4.0.0
lerna info bootstrap root only

> undefined prepare /Users/myself/projects/xmpp.js
> husky install

husky - Git hooks installed
audited 1444 packages in 7.753s

131 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

cd packages/xmpp.js/ && npm run prepublish

> xmpp.js@0.12.0 prepublish /Users/myself/projects/xmpp.js/packages/xmpp.js
> node script.js

node bundle.js
events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: Can't walk dependency graph: Cannot find module '@xmpp/client-core' from '/Users/myself/projects/xmpp.js/packages/client/browser.js'
    required by /Users/myself/projects/xmpp.js/packages/client/browser.js
    at /Users/myself/projects/xmpp.js/node_modules/resolve/lib/async.js:137:35
    at processDirs (/Users/myself/projects/xmpp.js/node_modules/resolve/lib/async.js:290:39)
    at isdir (/Users/myself/projects/xmpp.js/node_modules/resolve/lib/async.js:297:32)
    at /Users/myself/projects/xmpp.js/node_modules/resolve/lib/async.js:25:69
    at FSReqCallback.oncomplete (fs.js:168:21)
Emitted 'error' event on Readable instance at:
    at Labeled.<anonymous> (/Users/myself/projects/xmpp.js/node_modules/read-only-stream/index.js:28:44)
    at Labeled.emit (events.js:315:20)
    at Labeled.<anonymous> (/Users/myself/projects/xmpp.js/node_modules/stream-splicer/index.js:130:18)
    at Labeled.emit (events.js:315:20)
    at Deps.<anonymous> (/Users/myself/projects/xmpp.js/node_modules/stream-splicer/index.js:130:18)
    at Deps.emit (events.js:315:20)
    at /Users/myself/projects/xmpp.js/node_modules/module-deps/index.js:387:25
    at onresolve (/Users/myself/projects/xmpp.js/node_modules/module-deps/index.js:185:25)
    at /Users/myself/projects/xmpp.js/node_modules/browserify/index.js:528:22
    at /Users/myself/projects/xmpp.js/node_modules/browser-resolve/index.js:265:24 {

Environment OS: macOS 10.15.7 Node: v14.17.5 npm: v6.14.14 git: version 2.24.3 (Apple Git-128)

sonnyp commented 2 years ago

Can you try make after updating npm?

npm install -g npm

netmikey commented 2 years ago

I have the most up-to-date npm6 version installed. I'd rather not npm install -g in my environment. What version would you like me to test it with? 6 or 7?

sonnyp commented 2 years ago

7 please

netmikey commented 2 years ago

Yes, this was the culprit: it works with npm 7. Since the current nodejs LTS comes with npm 6 by default, we might want to document the npm 7 requirement?

sonnyp commented 2 years ago

Yep, I thought

  "engines": {
    "node": ">= 12.4.0",
    "npm": ">= 7"
  },

in package.json was enough but it looks like you didn't even get a warning.

I will add a CONTRIBUTING.md file with this and the instructions I shared with you previously in https://github.com/xmppjs/xmpp.js/issues/889#issuecomment-902786001

sonnyp commented 2 years ago

https://github.com/xmppjs/xmpp.js/commit/6bd956d633864fdc2e48e2fc7e03e342cdcdca7d