문제

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?

도움이 되었습니까?

해결책

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.

다른 팁

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.

cmd /c cd $(CURRENT_DIRECTORY) & node $(FILE_NAME) & pause
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top