!jsSjXenzDAnqfOlJYU:matrix.org

Node.js

276 Members
Node.js is a JavaScript runtime | https://nodejs.org/ | ✨ 🐢 🚀 ✨ | Mission statement: http://bit.ly/28Ix9uj36 Servers

Load older messages


SenderMessageTime
31 Jul 2021
@joepie91:pixie.townjoepie91 🏳️‍🌈and yep, exactly10:35:05
@tall-lengthiness-613:matrix.orgTall-Lengthiness-613 joined the room.18:06:16
2 Aug 2021
@thereyleer:matrix.org@thereyleer:matrix.org joined the room.16:10:28
@thereyleer:matrix.org@thereyleer:matrix.org left the room.16:10:57
3 Aug 2021
@ult-darkcaster:matrix.orgult-darkcaster joined the room.03:21:12
@alkis:matrix.orgalkisg On my Ubuntu 20.04, node -e require.paths is empty. If I run npm i -g module and then I try to import it, it says module not found 07:20:57
@alkis:matrix.orgalkisgDo I need to manually set some things like NODE_PATH, or is "global requires" supposed to be able to work out of the box, and something is wrong in my setup?07:21:34
@alkis:matrix.orgalkisgAre "global requires" a bad thing? Am I supposed to use "npm link" instead?07:42:10
@alkis:matrix.orgalkisgAh, manually setting NODE_PATH makes things work. OKish...07:44:12
@alkis:matrix.orgalkisg Better yet: ln -rs ~/.npm-global/lib/node_modules ~/.node_modules 07:47:23
@ryzokuken:1312.mediaryzokuken alkisg: you should really not be doing this 07:54:49
@ryzokuken:1312.mediaryzokukenif your package depends on X (by requiring it), then it should explicitly list it out as a dependency07:55:11
@ryzokuken:1312.mediaryzokukenwhat you're doing right now will work, but it's not permitted for a reason07:55:23
@ryzokuken:1312.mediaryzokukenfor one, each dependency should be appropriately versioned. A different major version of the same module might break your code in a way that is impossibly hard to debug...07:55:58
@alkis:matrix.orgalkisg ryzokuken: what I want is the equivalent of "suggested dependencies" of debian; i.e. I don't want npm i my-package to install these dependencies, but if the user does have them installed globally, then I can offer some additional things 07:56:22
@alkis:matrix.orgalkisgWhile optionalDependencies is the equivalent of "Recommends: " on debian; they get installed by default...07:56:55
@ryzokuken:1312.mediaryzokukenagain, why are you implying the presence of certain global dependencies? global packages are not supposed to be used this way07:57:31
@ryzokuken:1312.mediaryzokukenor maybe you mean that package X has both your package Y and a separate package Z in its own dependency list?07:57:58
@ryzokuken:1312.mediaryzokuken * or maybe you mean that package X has both your package Y and a separate package Z in its own dependency list?07:58:12
@alkis:matrix.orgalkisg To be more specific: my sch-webapps package targets users. BUT, in very limited cases, a few developers will also use it via command line and advanced myapp developer-params options; in that case, my app does some extra stuff 07:58:24
@alkis:matrix.orgalkisgI don't want simple users to get the extra dependencies that a couple of devs will require; it's a bit like...internal use?07:58:45
@alkis:matrix.orgalkisgWhat are global modules for, if not for such things?08:00:12
@alkis:matrix.orgalkisgI probably misunderstood their purpose...08:00:23
@alkis:matrix.orgalkisgAh found it at https://nodejs.dev/learn/npm-global-or-local-packages15:13:06
@alkis:matrix.orgalkisgEverything should be installed locally; only executables should be installed globally15:13:30
@alkis:matrix.orgalkisgThat indeed seems like a waste of resources, but I guess it would be difficult to properly manage versioned dependencies otherwise15:16:58
@alkis:matrix.orgalkisgHopefully this method won't be adopted by distributions, otherwise we'll end up needing 10 TB disks, as then "cp.flatpak" will need its own copies of all the system libraries, and "ls.appimage" / "cd.snap" will do the same... :D15:21:51
@blackoutmechanix:matrix.orgblackoutmechanix joined the room.23:29:33
4 Aug 2021
@bvidis:matrix.orgBenoît Vidis joined the room.12:27:01
@magila:nerdsin.spaceιχ joined the room.17:28:13

There are no newer messages yet.


Back to Room List