Visual Studio 2015 RC Gulp task runner not detecting tasks

后端 未结 6 2287
予麋鹿
予麋鹿 2021-02-18 18:08

I have a Gulpfile.js in Visual Studio 2015 RC with a single default task. For some reason it is not showing up in the Task Runner Explorer.

I had added gulp

相关标签:
6条回答
  • 2021-02-18 18:24

    In the release candidate, editing the devDependencies in package.json and then saving does not result in the packages being automatically restored/added to the project as I had expected. After saving package.json the packages were listed under NPM in the Dependencies node in Solution explorer, but with a caption "not installed" next to the package names. Manually invoking Restore Packages, as shown in the screenshot, causes Visual Studio to install the pacakges.

    After the node modules had been installed the gulp tasks were detected by the Task Runner Explorer.

    I hope this helps someone else.

    enter image description here

    0 讨论(0)
  • 2021-02-18 18:24

    I had the same problem and no-one of suggested method works for me. After re-installing NPM Task Runner the problem gone away. You can download latest NPM Task Runner from marketplace in following link.

    https://marketplace.visualstudio.com/items?itemName=MadsKristensen.NPMTaskRunner

    0 讨论(0)
  • 2021-02-18 18:32

    For me, Visual Studio crashed while installing the npm modules and it caused corruption in the npm cache.

    I had to clean the cache, delete node_modules, and install again.

    • Close Visual Studio
    • Open node command prompt
    • cd [PROJECT_DIR]
    • npm cache clean
    • rimraf node_modules
      • This will delete the node_modules folder when windows fails because of deep nested paths
      • To install rimraf:
      • npm install rimraf -g
    • npm install

    Now, open Visual Studio and it should work.

    0 讨论(0)
  • 2021-02-18 18:41

    I was also facing the same issue. Just restarted Visual Studio after adding the tasks to gulpfile.js and my problem was solved. All tasks were listed.

    enter image description here

    0 讨论(0)
  • 2021-02-18 18:45

    Answer taken from another question about gulp, but this worked for me

    I had the same problem migrating from VS2013 recently. As Josh noted in his comment here Visual Studio 2015 ships with an older version of node. In case you don't want to get stuck with whatever version of node is built into Visual Studio, you can tell it to use the version you have already installed. Go to Tools > Options > Projects and Solutions > External Web Tools and reorder locations so that $(PATH) is above $(DevEnvDir)\Extensions\Microsoft\Web Tools\External. This also applies to other tools like Grunt, Bower and Gulp.

    0 讨论(0)
  • 2021-02-18 18:49

    This is old question but same issue could be faced by VS 2017 users.

    I was facing same issue in VS 2017 and mistakenly, I had added gulpfile.js in the sub folder.

    Make sure gulpfile.js is in the root folder. gulpfile should be in root folder

    0 讨论(0)
提交回复
热议问题