Backstory
I've been trying to set up a project in Visual Studio, which uses GulpJS to compile Sass. I was told that VS should automatically recognize the package.json
inside a project and run npm install
, but I had to do that manually through a command line. Even then, when I opened Task Runner Explorer, it says that there are (No tasks found)
. My coworker and I looked up solutions that worked for other people, many of which reported having success after restarting VS, clearing some cached data, or reinstalling the node modules; however none of those worked for me. Here are some solutions I've attempted:
- Visual Studio 2015 RC Gulp task runner not detecting tasks (All Answers)
- https://stackoverflow.com/a/37437209/6425704
- Basically the entire first page of Google for "visual studio gulp no tasks found"
The Problem
After some digging, I came across the Package Manager Console and decided that maybe I can run gulp through that instead of opening a separate CMD window. However, when I did, I got the following:
[11:27:43] Local gulp not found in C:\
[11:27:43] Try running: npm install gulp
My immediate thought was that I might need to reinstall the dependencies, so I ran npm install
and got this output:
npm : npm WARN enoent ENOENT: no such file or directory, open 'C:\package.json'
At line:1 char:1
+ npm install
+ ~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (npm WARN enoent...:\package.json':String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
npm WARN !invalid#1 No description
npm WARN !invalid#1 No repository field.
npm WARN !invalid#1 No README data
npm
WARN
!invalid#1 No license field.
This is when I noticed that it is looking for C:\package.json
instead of the one inside my Project directory. However, when I ran ls
, it clearly shows that it's inside the Solution root, at C:\Dev\solution-name
. I tried navigating to the specific Project, using cd Presentation\Nop.Web
, but I still get the result of it looking in the C:\
root. Can anyone explain why this is happening and how I can fix it?