Page 1 of 1

Can't find npm [Solved]

PostPosted: Sep 26th, '18, 04:21
by jk121960
Hi and thanks, I am using Mageia 6 KDE new install, I installed npm but the system can't find it. The executable should be /usr/bin/npm there a soft link should point to ../lib/node modules/npm/bin/npm-cli.js but that soft link does not exist. Any help with this would be great, thanks in advance for your effort

Re: Can't find npm

PostPosted: Sep 26th, '18, 23:51
by doktor5000
jk121960 wrote:Hi and thanks, I am using Mageia 6 KDE new install, I installed npm but the system can't find it.

How do you try, or what is the error you're seeing? Just installed npm and it's present:



Code: Select all
[doktor5000@Mageia6]─[23:48:51]─[~] which npm
/bin/npm
[doktor5000@Mageia6]─[23:50:36]─[~] ls -al /bin/npm
lrwxrwxrwx 1 root root 38 Mai  5  2017 /bin/npm -> ../lib/node_modules/npm/bin/npm-cli.js*
[doktor5000@Mageia6]─[23:50:46]─[~]

[doktor5000@Mageia6]─[23:50:46]─[~] npm --help

Usage: npm <command>

where <command> is one of:
    access, adduser, bin, bugs, c, cache, completion, config,
    ddp, dedupe, deprecate, dist-tag, docs, edit, explore, get,
    help, help-search, i, init, install, install-test, it, link,
    list, ln, login, logout, ls, outdated, owner, pack, ping,
    prefix, prune, publish, rb, rebuild, repo, restart, root,
    run, run-script, s, se, search, set, shrinkwrap, star,
    stars, start, stop, t, tag, team, test, tst, un, uninstall,
    unpublish, unstar, up, update, v, version, view, whoami

npm <cmd> -h     quick help on <cmd>
npm -l           display full usage info
npm help <term>  search for help on <term>
npm help npm     involved overview

Specify configs in the ini-formatted file:
    /home/doktor5000/.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config

npm@3.10.10 /usr/lib/node_modules/npm
[✗]─[doktor5000@Mageia6]─[23:51:25]─[~]

Re: Can't find npm

PostPosted: Sep 27th, '18, 01:08
by jk121960
Hi and thanks, I installed from the package manager, but when I go to use it from cli, it says it can't find it. the link from /usr/bin/npm is a dead soft link. The soft link reads ../lib/node_modules/npm/bin/npm-cli.js but there is nothing there. I have uninstalled rebooted and reinstalled and the same thing, oddly I can see npm was there at one point as there is a boatload of node modules installed under an npm directory. As far as that link, it is present up until the npm before the bin, the bin and whatever is in it is gone.

Thanks in advance for any help or advice

Re: Can't find npm

PostPosted: Sep 27th, '18, 23:07
by doktor5000
The file which the symlink is pointing to is contained in the nodejs subpackage AFAICT, but I don't have an mga system to check right now. So you may want to reinstall that.
Code: Select all
urpmi --replacepkgs --replacefiles npm nodejs

should help.

Re: Can't find npm (resolved)

PostPosted: Sep 28th, '18, 01:04
by jk121960
Great thanks, worked like a charm, your awesome thank you, saved from a reinstall

Re: Can't find npm

PostPosted: Sep 28th, '18, 06:33
by doktor5000
Please mark the thread as solved by editing the subject of the first post and prefix it with [SOLVED ], thanks in advance.

Re: Can't find npm [Solved]

PostPosted: Sep 28th, '18, 12:21
by jk121960
Done and thanks again