I am trying to use Visual Studio Code as Google Sheets Script editor on a win 10 machine.
To make a long story short I will not describe all my steps, as I didn't really understood at the beginning exactly what I need. I also wouldn't be able to do it even I want to.
The current situation is that clasp is not recognized on the system. These are command line results:
c:\>where npm
C:\Program Files\nodejs\npm
C:\Program Files\nodejs\npm.cmd
c:\>where clasp
C:\Users\XXX\AppData\Roaming\npm\clasp
C:\Users\XXX\AppData\Roaming\npm\clasp.cmd
on drive c: root (and any folder other than C:\Users\XXX\AppData\Roaming\npm\clasp
) clasp is not recognized
c:\>clasp -v
'clasp' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\XXX\AppData\Roaming\npm>clasp -v
2.3.0
One suggestion I found is setting Windows user variable as follows:
SET NODE_PATH=% APPDATA%\npm
Didn't help.
npm related paths on Windows PATH
:
C:\Users\XXX\AppData\Roaming\npm
I tried to add to PATH
the following file path before the one above
C:\Program Files\nodejs\npm
Didn't help
Based on this post looks like npm is actually installed twice. For current user C:\Users\XXX\AppData\Roaming\npm
and for all users C:\Program Files\nodejs\npm
.
Maybe this is the problem.
I would like to start over from clean env.
How can I uninstall the local user npm installation on C:\Users\XXX\AppData\Roaming\npm
?
You need to add path to npm in environment variables. Then it will work.
%AppData%
and hit enternpm
folder insideroaming
and check if a file namedclasp
is there or notnpm
in environment variablesC:\Users\HARI\AppData\Roaming\npm