2

So I've been working on a asp.net core project and trying to inject scripts using the gulp-inject package. but when I try to use the gulp-inject module in gulpfile.js it throws this error in task-runner window. what am I missing here?

[gulp-inject in package.json

gulp-inject in package.json

task-runner error

task-runner error

Shaun Luttin
  • 133,272
  • 81
  • 405
  • 467
Mr. Hello
  • 68
  • 6

1 Answers1

1

This is a known issue. You need to upgrade your version of NodeJS to v4.

To see your version, open a command prompt and run:

node --version  

To upgrade, go to https://nodejs.org and find the downloads or look at How do I update node and npm on windows?

If you're using Visual Studio 2015, also check the version of NodeJS that it is using. Options > Projects and Solutions > External Web Tools shows the locations. From there either:

  1. add C:\Program Files\nodejs as the new top entry, or
  2. move the $(PATH) to the top if it is already up-to-date.

External Web Tools

Community
  • 1
  • 1
Shaun Luttin
  • 133,272
  • 81
  • 405
  • 467
  • 1
    my node version is 4.2.3. still having the issue – Mr. Hello Apr 25 '16 at 19:54
  • @FiyazBinHasan I added a way to investigate Visual Studio's tooling. – Shaun Luttin Apr 25 '16 at 20:00
  • 1
    i've moved the $(PATH) to the top. since my path is updated now its working. but is it a preferred way? – Mr. Hello Apr 25 '16 at 20:10
  • @FiyazBinHasan Moving the `$(PATH)` to the top seems like a good way to me. Well done. I suppose you could also investigate where the other `NodeJS` installation is located and then update it too. That would be thorough though probably not necessary. – Shaun Luttin Apr 25 '16 at 20:33