[RESOLVED] Ubuntu / Languages & Frameworks > npm Not found

Hi there, PhpStorm is great, but I'm having an issue with npm not found:

My environment seems ok to me, example:

And, at "Package manager" field if I try to select by myself informing the path like "/usr/share/npm/bin" it doesn't work neither, nothing happens.

So... How can I get my npm package manager working in PhpStorm, any clue...?

My PhpStorm info:

PhpStorm 2018.1.5
Build #PS-181.5281.19, built on June 7, 2018
JRE: 1.8.0_152-release-1136-b39 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.4.0-31-generic

Thank you!

PS.: what I am really trying to do is just have my jQuery support enabled in PhpStorm, but first I need to get over the "Can not install Node.js module: Please specify npm or yarn package" error message when downloading TypeScript community stubs.

0
13 comments

Please try specifying a full path to npm package (like /usr/local/lib/node_modules/npm) in this field (note that it should be a package, not a binary, /usr/bin/npm won't work. Normally npm is installed to {prefix}/lib/node_modules, where prefix can be obtained via npm config get prefix

 

0
Avatar
Permanently deleted user

Hi Elena, thank you for your reply, I hope I can get this working :-)

Unfortunately, it didn't work, I've still got red in the field, and looking at `/usr/local/lib/node_modules` the only content is the `bower` subfolder. Please take a look:

0

what is the result of running npm config get prefix?

0
Avatar
Permanently deleted user

 Hi, I've already put at previous image :-) I got /usr/local

Tks.

0

weird... please run npm --help and provide the full output

0
Avatar
Permanently deleted user

Hi, here it goes, please also see after the output.

fernando@rohan:~$ npm --help

Usage: npm <command>

where <command> is one of:
    access, add-user, adduser, apihelp, author, bin, bugs, c,
    cache, completion, config, ddp, dedupe, deprecate, dist-tag,
    dist-tags, docs, edit, explore, faq, find, find-dupes, get,
    help, help-search, home, i, info, init, install,
    install-test, issues, it, la, link, list, ll, ln, login,
    logout, ls, outdated, owner, pack, ping, prefix, prune,
    publish, r, rb, rebuild, remove, repo, restart, rm, root,
    run-script, s, se, search, set, show, shrinkwrap, star,
    stars, start, stop, t, tag, team, test, tst, un, uninstall,
    unlink, unpublish, unstar, up, update, upgrade, v, verison,
    version, view, whoami

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

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

npm@3.5.2 /usr/share/npm
fernando@rohan:~$

I was able to get the npm version 3.5.2 using "/usr/share/npm" at the Package manager field, good! But, still the IDE shows me the error message "Please specify npm or yarn package" when I try to install the "jquery" package, example:

0

>I was able to get the npm version 3.5.2 using "/usr/share/npm" at the Package manager field, good!

 

great, thanks for update:)

 

>But, still the IDE shows me the error message "Please specify npm or yarn package" when I try to install the "jquery" package

 

https://youtrack.jetbrains.com/issue/WEB-31858 is fixed in 2018.2.... Does the issue persist after upgrading?

2
Avatar
Permanently deleted user

Great, I've updated the IDE and now it's working, thank you!

3

Fine, thank you for patience and cooperation:)

0

Hi,

I still have the problem with the latest version of IntelliJ IDEA. The only workaround I found is to launch Xcode before launching IDEA.

3

For me works path /snap/node/current/lib/node_modules/npm

0

For OpenSUSE works path /usr/lib64/node_modules/npm14  or /usr/lib64/node_modules/npm[your node major version number]

0

Or so as not to add a path every time:

sudo mkdir /usr/lib/node_modules/

sudo ln -s /usr/lib64/node_modules/npm14/ /usr/lib/node_modules/

mv /usr/lib/node_modules/npm14/ /usr/lib/node_modules/npm/ 

or

sudo ln -s /usr/lib64/node_modules/npm[your node major version number]/ /usr/lib/node_modules/

mv /usr/lib/node_modules/npm[your node major version number]/ /usr/lib/node_modules/npm/ 

(For OpenSUSE )

0

Please sign in to leave a comment.