[Bug 985350] New: NodeJS non-standard module search paths
http://bugzilla.opensuse.org/show_bug.cgi?id=985350 Bug ID: 985350 Summary: NodeJS non-standard module search paths Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: Development Assignee: bnc-team-screening@forge.provo.novell.com Reporter: amajer@suse.de QA Contact: qa-bugs@suse.de Found By: --- Blocker: ---
From https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs comments,
qantas94heavy wrote about 22 hours ago With the change in https://build.opensuse.org/request/show/401914, does this now mean that modules installed would now resolve to something when require()'d when they did not before? Also this removes a folder which is documented to be checked (mainly for historic reasons), would this have any effect on users? https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders --------------------------------------------- Marguerite Su MargueriteSu wrote about 18 hours ago Did any trouble occur with this change? historically, openSUSE never used %{_libdir}/node for any purpose (we started providing nodejs from 12.2). no module was installed into that directory, no rpm macro was defined to be that directory. so, unleass upstream decide to use that directory again, in packaging, I think this change is consistent, it is just a fix for that our nodejs kept checking a non-used directory. --------------------------------------------- Karl Cheng qantas94heavy wrote about 7 hours ago With the change, if you do something like the following: npm install -g jshint node
require('jshint')
Then it'll load the module, which is inconsistent with default Node.js behaviour and other distributions: https://docs.npmjs.com/getting-started/installing-npm-packages-globally --------------------------------------------- Marguerite Su MargueriteSu wrote about 6 hours ago please file a bugreport. still didn't get your concern. will discuss it there. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=985350 Adam Majer <amajer@suse.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|bnc-team-screening@forge.pr |amajer@suse.de |ovo.novell.com | -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=985350 http://bugzilla.opensuse.org/show_bug.cgi?id=985350#c1 --- Comment #1 from Adam Majer <amajer@suse.de> --- This could be valid bug, but then it depends on how NodeJS module installs are suppose to happen. If we are to package NodeJS modules that normally get installed with `npm` for use by all programs, then these should be installed in a search location. On the other hand, if you are only suppose to install globally system binaries, then those probably should not be accessible to all NodeJS programs. We can do a number of things here. But looking at Debian, their npm installs things in /usr/local prefix, not /usr. Perhaps changing `npm install -g` to install things under /usr/local and keep search path /usr/lib{,64}/node_modules for system installed modules would be a compromise here? -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=985350 http://bugzilla.opensuse.org/show_bug.cgi?id=985350#c2 --- Comment #2 from Adam Majer <amajer@suse.de> --- OK, so an idea is to 1. make `npm` install things under /usr/local prefix, not /usr 2. change nodejs to look again under /usr/lib{,64}/node 3. packaged nodejs modules to install under /usr/lib{,64}/node os Then /usr/lib{,64}/node_modules becomes legacy in OpenSUSE Rationale, 1. 'npm' shouldn't dump things under /usr - it should be treated as read-only filesystem 2. shouldn't really install executables under /var because that's local to system 3. /usr/local could theoretically be network shared, and it also has /usr/local/bin and all that stuff, so consistent if there are links to executables linked from /usr/local/bin to /usr/local/lib/node_modules. 4. current stuff installed on user machines under /usr/lib{,64}/node_modules keeps working Or, keep /usr/lib/node_modules as search path and install packaged nodejs modules there. And let users sort out if they don't want currently installed modules in search path? In either case, currently letting 'npm' install under /usr is not good. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=985350 http://bugzilla.opensuse.org/show_bug.cgi?id=985350#c3 Karl Cheng <qantas94heavy@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |qantas94heavy@gmail.com --- Comment #3 from Karl Cheng <qantas94heavy@gmail.com> --- The plan specified above seems to be a reasonable idea to me. -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com