The pathway specified is untraceable by the gulp system

Hey there, I've encountered an issue with my project that uses gulp. The gulpfile.js suddenly stopped working without any changes made to it.

The output I'm getting is:

cmd.exe /c gulp --tasks-simple The system cannot find the path specified.

gulpfile.js

/// <binding ProjectOpened='watchTS' />
var gulp = require('gulp');
var less = require('gulp-less'),
    path = require('path'),
    rename = require('gulp-rename'),
    del = require('del'),
    ts = require('gulp-typescript'),
    sourcemaps = require('gulp-sourcemaps'),
    concat = require('gulp-concat'),
    uglify = require('gulp-uglify'),
    tslint = require('gulp-tslint'),
    sloc = require('gulp-sloc'),
    debug = require('gulp-debug'),
    typedoc = require('gulp-typedoc');
    
var lib = './lib/';

var tsProject = ts.createProject('tsconfig.json');

gulp.task('init',function(){
    del.sync('./lib/');
    gulp.src([
        './node_modules/jquery/dist/jquery.min.js',
        './node_modules/d3/d3.min.js',
        './node_modules/angular/angular.min.js',
        './node_modules/n3-charts/build/LineChart.min.js',
        './node_modules/angular-route/angular-route.min.js',
        './node_modules/floatthead/dist/jquery.floatThead.min.js',
        './node_modules/angular-google-chart/ng-google-chart.min.js',
        './node_modules/angular-ui-bootstrap/dist/ui-bootstrap-tpls.js'
     ])
    .pipe(concat('lib.js'))
    .pipe(gulp.dest('lib'));

    gulp.src([
        './node_modules/bootstrap/dist/css/bootstrap.css',
        './node_modules/n3-charts/build/LineChart.min.css'
    ])
    .pipe(gulp.dest('lib'))
});

gulp.task('slocTS', function () {
    return gulp.src(['FrontEnd/**/*.ts'])
    //.pipe(debug())
    .pipe(sloc({ tolerant: true }))
})

gulp.task('slocJS', function () {
    return gulp.src(['Scripts/**/*.js'])
    //.pipe(debug())
    .pipe(sloc())
})

/** Builds out documentation for our environment on the typescript side*/
gulp.task('buildDocs', function () {
    return gulp.src(['FrontEnd/**/*.ts'])
        .pipe(typedoc({
            target: 'es5',
            out: 'FrontEnd/docs/',
            mode: 'file'
        }));
})

gulp.task('buildTSLogin', function () {
    return gulp.src(['FrontEnd/**/*.ts', '!FrontEnd/ApplicationStartup.ts'])
    .pipe(tslint())
    .pipe(sourcemaps.init())
    .pipe(ts(tsProject))
    .pipe(concat('loginApp.js'))
    .pipe(sourcemaps.write())
    .pipe(gulp.dest('lib'));
});

gulp.task('buildTS', function () {
    return gulp.src(['FrontEnd/ApplicationStartup.ts', 'FrontEnd/**/*.ts'])
    .pipe(tslint())
    .pipe(tslint.report('verbose', {
        emitError: false
    }))
    .pipe(sourcemaps.init())
    .pipe(ts(tsProject))
    .pipe(concat('app.js'))
    /*.pipe(uglify({
        mangle:true
    }))*/
    .pipe(sourcemaps.write())
    .pipe(gulp.dest('lib'));
});

gulp.task('buildProductionTSLogin', function () {
    return gulp.src(['FrontEnd/**/*.ts', '!FrontEnd/ApplicationStartup.ts'])
    .pipe(ts(tsProject))
    .pipe(concat('loginApp.js'))
    .pipe(uglify({
        mangle: true
    }))
    .pipe(gulp.dest('lib'));
});

gulp.task('buildProductionTS', function () {
    return gulp.src(['FrontEnd/ApplicationStartup.ts', 'FrontEnd/**/*.ts'])
    /*.pipe(tslint())
    .pipe(tslint.report('verbose', {
        emitError: false
    }))
    .pipe(sourcemaps.init())*/
    .pipe(ts(tsProject))
    .pipe(concat('app.js'))
    .pipe(uglify({
        mangle: true
    }))
    /*.pipe(sourcemaps.write())*/
    .pipe(gulp.dest('lib'));
});

gulp.task('buildProduction', ['init', 'buildProductionTSLogin'], function () {
    gulp.start('buildProductionTS');
})

gulp.task('watchTS', function () {
    gulp.watch('FrontEnd/**/*.ts', function (event) {
        console.log('File ' + event.path + ' was ' + event.type + ', running tasks...');
        gulp.start('buildTS');
        //gulp.start('buildTSLogin');
    });
})

Additionally, my packages.json includes:

 "devDependencies": {
    "del": "^2.0.1",
    ...
  

This project was handed down to me so I'm still learning about its functionalities. It has been running smoothly for years until now.

Recently, I updated TypeScript and migrated from a typings folder to using @types. Although the project worked fine after the update, it suddenly stopped functioning. All required packages are installed correctly in the node_modules folder, and the project builds error-free in Visual Studio.

Edit: After some troubleshooting, I discovered that if I run the gulp commands mentioned above directly from the command line at the specified path, they work successfully.

Edit2: I'm quite frustrated as my task runner explorer keeps showing this output:

cmd.exe /c gulp --tasks-simple
The system cannot find the path specified.

cmd.exe /c gulp --tasks-simple
The system cannot find the path specified.

cmd.exe /c gulp --tasks-simple
The system cannot find the path specified.

Answer №1

After dedicating an excessive amount of time to troubleshooting this issue, I eventually uncovered the solution. It turned out that relocating my $(PATH) under the visual studio locations of external tools was the key. This discovery was inspired by the insights shared in this particular response.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

A guide on combining two native Record types in TypeScript

Is it possible to combine two predefined Record types in TypeScript? Consider the two Records below: var dictionary1 : Record<string, string []> ={ 'fruits' : ['apple','banana', 'cherry'], 'vegeta ...

Exploring the inner workings of the canDeactivate guard feature in Angular

Exploring the concept of guards in Angular has sparked a question in my mind. Why can't we simply have a class with a deactivate method that we can import and use as needed? The provided code snippets illustrate my confusion. export interface CanComp ...

Manifest file for jQuery plugins/npm

Have you ever wondered why jQuery plugins come with their own manifest file .jquery.json instead of utilizing npm and its package.json? It seems like dependencies management and hosting files could be handled by npmjs.org effectively... Is anyone else cur ...

Allowing cross-origin resource sharing (CORS) in .NET Core Web API and Angular 6

Currently, I am facing an issue with my HTTP POST request from Angular 6. The request is successfully hitting the .net core Web API endpoint, but unfortunately, I am not receiving the expected response back in Angular 6. To make matters worse, when checkin ...

"Error encountered while executing a code snippet using Navalia in TypeScript

I have been attempting to execute this code snippet from https://github.com/joelgriffith/navalia but despite my efforts, I have not been able to get it running smoothly without encountering errors: navaliatest.ts /// <reference path="typings.d.ts" /&g ...

Is there a way to disable the ability for a logged-in user to like or comment on their own post?

I'm currently in the process of developing a mini social media API and I want to implement a feature where users can like and comment on posts made by others, but not on their own posts. However, I've encountered an issue with my current like sy ...

Transitioning from MVC to Angular 2 and TypeScript: A Step-by-Step Guide

Seeking guidance as I venture into the world of Angular. My goal is to pass a string variable 'element' to my UI and utilize it. However, I am unsure about how to go about passing it inside main.js and beyond. How can I transfer a variable to a t ...

JavaScript and Angular are used to define class level variables

Hello, I'm currently diving into Angular and have encountered an issue with a class level variable called moratoriumID in my component. I have a method that makes a POST request and assigns the returned number to moratoriumID. Everything seems to work ...

Error encountered with object.map() function - what fundamental concept am I missing?

Could someone lend me a fresh set of eyes on this... The React Component is fetching data from MariaDB using a useEffect() hook. The data is retrieved successfully without any errors, and the console.log shows the correct data (refer to the image below). ...

Utilize an alias to define the SCSS path in an Angular-CLI library project

I am in the process of developing a library project using angular-cli. I have been following the guidelines outlined in the angular documentation. This has resulted in the creation of two main folders: one is located at ./root/src/app, where I can showcase ...

What distinguishes between the methods of detecting falsy and truthy values?

While working with JavaScript / Typescript, I often find myself needing to verify if a length exists or if a value is true or false. So, the main query arises: are there any differences in performance or behavior when checking like this... const data = [ ...

What steps can I take to avoid an invalid operation on a potentially null reference in typescript?

Take a look at this scenario where the variable a can potentially be null, and is explicitly defined as such. Even when strict null checks are enabled, TypeScript does not flag a possible issue in this situation - let a: string | null = "hello" function ...

What is the best method for setting up npm on Opsworks Rails application layer running on Ubuntu 12.04?

When using Ubuntu 12.04, the installation of nodejs from the regular sources results in an older version (0.6) that does not include npm. To access npm, it is necessary to manually install the upstream version. Similarly, adding nodejs to OS packages on t ...

Typescript error: Import statement not allowed here

Recently delving into the world of TypeScript, I encountered an issue when attempting to build for production. My first step was running tsc Although this step passed without any errors, I faced import errors when trying to execute the build file with ...

Troubles encountered with switching npm registry

In my Vue 2.7 project with vuetify, I initially installed dependencies using a custom local npm registry, acting as a proxy to the default npm. As the project has expanded, I've started using git actions to deploy to a development server, with varying ...

Creating a dynamic visual experience with Angular 2: How to implement multiple font colors

I have a text area which is connected to one string, with the default text color set to white. <textarea style="background-color: black;color:#fff;" [(ngModel)]="outputText"></textarea> The connected string contains multiple variables. retur ...

Node.js fails to initialize

Update: I decided to modify the title of this question for better accuracy. This is the content of my package.json file: { "name": "application-name", "version": "0.0.1", "private": true, "scripts": { "start": "node ./bin/www" }, "dependencies": { ...

"Techniques for extracting both the previous and current selections from a dropdown menu in Angular 2

How can I retrieve the previous value of a dropdown before selection using the OnChange event? <select class="form-control selectpicker selector" name="selectedQuestion1" [ngModel]="selectedQuestion1" (Onchange)="filterSecurityQuestions($event.t ...

Retrieving information from a JSON object in Angular using a specific key

After receiving JSON data from the server, I currently have a variable public checkId: any = 54 How can I extract the data corresponding to ID = 54 from the provided JSON below? I am specifically looking to extract the values associated with KEY 54 " ...

Addressing dependencies among peers during NPM builds

Today has been quite the challenge as I navigate through some peer dependency issues. Development mode runs smoothly, but once I build, errors like "error TS2786: 'Chart' cannot be used as a JSX component. Its type 'typeof Chart' i ...