SCSS File Watcher error - '"node"' is not recognized
Hi,
I'm running PhpStorm 2023.2.2 (PS-232.9921.55) on Windows 11 and I'm experiencing an error every time the SCSS File Watcher tries to run.
cmd.exe /D /C call C:\Users\[MY_USERNAME]\AppData\Roaming\npm\sass.cmd screen.scss:screen.css
'"node"' is not recognized as an internal or external command,
operable program or batch file.
Process finished with exit code 1
This only started today. It was running fine a couple of days ago and I'm unaware of anything substantial being changed on my system since then (but presumably something got updated / changed). I checked and noticed there was a PHPStorm update which I applied. So I'm now running the latest version, along with the latest version of all plugins (including Node.js). But I am getting the same error after the update as I got before.
I have also confirmed that the nodejs folder (inside C:\Program Files) is set as an Environment Variable within Windows.
Any ideas?
Jim.
Please sign in to leave a comment.
The error indicates that
node
is not in your%PATH%
. What is a result of runningwhere node
in Windows cmd console? Does the issue persist on re-booting the PC?You don't have
node.exe
in this folder, thus the issueI'd suggest re-installing Node.js interpreter
Hi Elena,
Many thanks for your response. Unfortunately the issue does persist after rebooting Windows.
When I open the Windows Command Prompt and type “where node”, I receive the following response:
INFO: Could not find files for the given pattern(s).
Do I need to be in a particular directory to get a response from “where node”? Or does that suggest a problem?
Thanks again,
Jim.
This command should work anywhere if the corresponding executable can be resolved by name. The result of the command execution confirms my assumption that
node
is not in your%PATH%
.Please run
echo %PATH%
in your system cmd console - what is a result?Hi Elena,
I can see
C:\Program Files\nodejs\;
when I run that command…Command:
C:\>echo %PATH%
Response:
C:\Program Files\ImageMagick-7.1.1-Q16-HDRI;C:\Python310\Scripts\;C:\Python310\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\dotnet\;C:\Program Files\PuTTY\;C:\Program Files\nodejs\;C:\ProgramData\chocolatey\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\xampp\mysql\bin;C:\Users\[MY_USERNAME]\AppData\Local\Microsoft\WindowsApps;C:\Program Files\JetBrains\PhpStorm 2022.2.2\bin;;C:\Users\[MY_USERNAME]\AppData\Roaming\npm;C:\Users\[MY_USERNAME]\AppData\Local\GitHubDesktop\bin;
Weird. And what is a result of
node -v
?Command:
C:\>node -v
Response:
'node' is not recognized as an internal or external command,
operable program or batch file.
Does it work if you cd to
C:\Program Files\nodejs
and run the command there? If yes, I'd suggest editingPATH
in your system environment variables by appendingC:\Program Files\nodejs
to it and then re-booting the machineEven when I cd to
C:\Program Files\nodejs
I get the same response:Command:
C:\Program Files\nodejs>node -v
Response:
'node' is not recognized as an internal or external command,
operable program or batch file.
And this is the contents of the C:\Program Files\nodejs folder:
Fantastic. Thanks Elena! That appears to be working now (after I reinstalled Node.js).
Very weird that node.exe was missing. As I say, this all worked last Friday and I have no idea what might have changed since then. But I'm not going to complain as long as it's working.
Thank you again.
Jim.