D
D
Danil O'neil2021-02-15 22:07:57
Task Schedulers
Danil O'neil, 2021-02-15 22:07:57

Gulp does not run default task. What is the problem?

Good day! Please tell me what else could be the problem?

gulpfile.js:

const gulp = require('gulp'); 

gulp.task('default', function() {
    console.log('DEFAULT')
});


I write to the console:
PS C:\Users\User\myFolders\myWebDev\gulpBuild> gulp

in reply:
PS C:\Users\User\myFolders\myWebDev\gulpBuild> gulp
gulp : Невозможно загрузить файл C:\Users\User\AppData\Roaming\npm\gulp.ps1, так как выполнение сценариев отк
лючено в этой системе. Для получения дополнительных сведений см. about_Execution_Policies по адресу https:/go 
.microsoft.com/fwlink/?LinkID=135170.
строка:1 знак:1
+ gulp
+ ~~~~
    + CategoryInfo          : Ошибка безопасности: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess


Installed both globally and locally, changed several nodejs versions, played around with path - all in vain. What else needs to be done?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Danil O'neil, 2021-02-17
@daniloneil

As a result, I did the following:
1. wiped everything that I had installed earlier.
2. reinstalled node and npm.
3. assigned gitbash in editor instead of cmd/powershell and executed:
npm install --global gulp-cli
then
npm init
later
npm install gulp
in galpfile:

const gulp = require('gulp');

gulp.task('default', function(cb) {
    console.log('DEFAULT');
    cb();
});

in gitbash
$ gulp
[19:28:36] Using gulpfile ~\myFolders\myWebDev\gulpBuild\gulpfile.js
[19:28:36] Starting 'default'...
DEFAULT
[19:28:36] Finished 'default' after 4.28 ms

A
Alexander, 2021-02-16
@Seasle

Use cmd.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question