2

I'm trying to run some nodejs apps in Notepad++. I installed NppExec and node works just fine in the console, but npm packages don't run even though I installed them with the -g flag. My current workaround is to call cmd from the console and then running the app like:

// `cmd` inside Notepad++ console

C:\>lessc "$(FULL_CURRENT_PATH)" > "$(CURRENT_DIRECTORY)\$(NAME_PART).css" 

How can I run it straight from the Notepad++ console without having to go into cmd?

elclanrs
  • 92,861
  • 21
  • 134
  • 171

3 Answers3

4

Frankly this looks like a bug in NppExec, where it cannot run .cmd files from PATH.

A workaround would be to run:

where lessc

You'll get the path to the command like: C:\Users\username\AppData\Roaming\npm\lessc.cmd
Use that path inside NppExec console.

C:\Users\username\AppData\Roaming\npm\lessc.cmd "$(FULL_CURRENT_PATH)" > "$(CURRENT_DIRECTORY)\$(NAME_PART).css"

However I'd stick to the solution you already found, looks far more better to me.

mihai
  • 37,072
  • 9
  • 60
  • 86
0

Know this is old but still appears high up google results. To run .bat or .cmd you need to add the extension.

npp.cmd start

From Docs Npp_Exec Manual:

The same approach can be used to execute .bat and .cmd files - but the file extension (.bat or .cmd) can not be omitted in this case.

Euan
  • 1
0
cmd /c cd $(CURRENT_DIRECTORY) & node $(FILE_NAME) & pause
Nathan Tuggy
  • 2,237
  • 27
  • 30
  • 38
Victor
  • 1
  • 2
    Could you please [edit] in an explanation of why this code answers the question? Code-only answers are [discouraged](http://meta.stackexchange.com/q/148272/274165), because they don't teach the solution. – Nathan Tuggy Mar 14 '17 at 22:58