npm / gulp not recognized error + Primordials is not defined in task runner explorer for Sitecore Habitat project in Visual Studio 2019
npm Error:
'npm' is not recognized as an internal or external command, operable program or batch file.
Check if nodejs folder exists in c:\program files\
If not existing, install nodejs from here - https://nodejs.org/en/
Then, the nodejs folder will be created under c:\program files
Note that in the environment (system) variables, the path will also be added automatically:
Note that if nodejs folder is present in the file system but not added to the system variables list above, the npm command will not be recognized in the command prompt. So, the path needs to be added manually then.
Ensure to run npm command in a new command prompt window to check if the command is recognized.
Check gulp version with gulp -v
If gulp is not recognized across the file system,
Run npm install -g gulp
Once the install is successful, Open a new command prompt window and check gulp -v
Then, in Tools > Options, move the $PATH to top as per this answer - https://sitecore.stackexchange.com/questions/26160/issue-in-loading-gulp-tasks-in-vs-net-2019-failed-to-load
Then, reload the gulpfile.js in the task explorer window to see the tasks load fine:
Comments
Post a Comment