Call npm from commstorm command-line tool

I start with grunt in webstorm (on windows) and cannot call npm (the node plugin is installed and enabled, node.exe is in the system path).

npm init

what command line tools are output:

module.js:340 throw err; ^ Error: Cannot find module 'C:\nodejs\node_modules\npm\bin\node_modules\npm\bin\npm-cli.js' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:901:3 Process finished with exit code 8 

thanks

+4
source share
1 answer

configure NPM with the command line in Webstorm:

Webstorm 6, you need to add a command line support plugin:

File> Settings> IDE Settings> Plugins> Command Line Tool Support

after you added to webstorm, then

File> Settings> Project Settings> Command Line Tool Support

click "+" to add> in the pop-up window Tool path: C: \ Program Files \ nodejs \ npm.cmd Alias: npm (or whatever you like) visibility: select whatever you like then> OK> Apply> OK

in webstorm> Tools> Launch Command> or (Coomand Line Tools Console) enter the command in the bottom line: npm

you will see a result similar to

C: \ Program Files \ nodejs \ npm.cmd

Usage: npm

where one of: add-user, adduser, apihelp, author, bin, bugs, c, cache, completion, config, ddp, dedupe, deprecate, docs, edit, search, search, search, search, search, help, search, search, home, i, info, init, install, isntall, questions, la, link, list, ll, ln, login, ls, outdated, owner, package, prefix, trim, publish, r, rb, rebuild, delete, repo, restart, rm, root, run-script, s, se, search, set, show, shrinkwrap, star, stars, start, stop, submodule, tag, test, tst, un, delete, unlink, cancel publication, unlock, refresh, refresh, look, whoami

npm -h npm quick help -l show full usage information Frequently asked questions npm help find npm help help npm involved review

Specify configs in the in-format file: C: \ Users \ kpatel.npmrc or in the command line via: npm - key value Configuration information can be viewed via: npm help config

npm@1.3.8 C: \ Program Files \ nodejs \ node_modules \ npm

The process terminated with exit code 0 at 14:32:10. Lead time: 794 ms.

+9
source

Source: https://habr.com/ru/post/1483703/


All Articles