I am new bee to gruntjs , i am facing small issues. pls dont mark as -ve .Thanks people
I have the following code in Gruntfile.js
module.export = funtion(grunt){
grunt.registerTask('default',"", function(){
grunt.log.write("Tis a a task ");
});
};
i am trying to execute the above js file from cmd prompt as follows and it throws the following error.
D:\vkishore\Demo\Condo_gruntjsDemo>grunt
Loading "Gruntfile.js" tasks...ERROR
>> SyntaxError: Unexpected token {
Warning: Task "default" not found. Use --force to continue.
Aborted due to warnings.
Related
I'm on MacPro OS 10.12 (can not be upgraded to 10.13 or beyond bc HW is old!) and I get below error.
Any help please
Thanks
Task start deno run -A --watch=static/,routes/ dev.ts
Watcher Process started.
The manifest has been generated for 3 routes and 1 islands.
Server listening on http://localhost:3000
dyld: Symbol not found: _SecTrustEvaluateWithError
Referenced from: /Users/kemalgencay/Library/Caches/esbuild/bin/esbuild-darwin-
64#0.14.39
Expected in: flat namespace
An error occured during route handling or page rendering. Error: The service was
stopped
at https://deno.land/x/esbuild#v0.14.39/mod.js:1304:25
at https://deno.land/x/esbuild#v0.14.39/mod.js:633:9
at afterClose (https://deno.land/x/esbuild#v0.14.39/mod.js:611:7)
at https://deno.land/x/esbuild#v0.14.39/mod.js:1844:11
error: Uncaught (in promise) BrokenPipe: Broken pipe (os error 32)
Watcher Process finished. Restarting on file change...
"devDependencies": {
"esbuild-wasm":"latest"
},
"overrides": {
"esbuild":"npm:esbuild-wasm#latest"
}
Just add this to the package.json
And then run: npm install
Hope it helps!
Getting the following warning message in Grunt.js:
Warning: Unable to write "filepath" file (Error code: EPERM). Use --force to continue.
Aborted due to warnings.
Process terminated with code 3.
To solve this error, remove the Read-only property from the parent folder's Properties.
I made some changes to my gulpfile.js. Then I received the following syntax error in my terminal after executing the gulp command:
'version' errored after 657 μs
SyntaxError: Unexpected token }
at Object.parse (native)
at VersionTask.deleteManifestFiles (/var/www/html/work/node_modules/laravel-elixir/dist/tasks/VersionTask.js:114:29)
at VersionTask.gulpTask (/var/www/html/work/node_modules/laravel-elixir/dist/tasks/VersionTask.js:72:18)
at VersionTask.run (/var/www/html/work/node_modules/laravel-elixir/dist/tasks/Task.js:139:31)
at /var/www/html/work/node_modules/laravel-elixir/dist/tasks/GulpBuilder.js:60:37
at Array.forEach (native)
at Gulp.<anonymous> (/var/www/html/work/node_modules/laravel-elixir/dist/tasks/GulpBuilder.js:59:54)
at module.exports (/var/www/html/work/node_modules/orchestrator/lib/runTask.js:34:7)
at Gulp.Orchestrator._runTask (/var/www/html/work/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep (/var/www/html/work/node_modules/orchestrator/index.js:214:10)
Looking in my public/build/css directory I noticed all my css versions are incorrect. How could this happen? How should I fix it?
gulpfile.js
const elixir = require('laravel-elixir');
require('laravel-elixir-vue');
elixir(mix => {
// for the application, after login
mix.sass(['styles.scss','imports.scss'])
.version(['css/styles.css','css/imports.css']);
});
After opening the rev-manifest.json file in the public/build/ directory, I discovered it was somehow missing css/imports-xxxxxxx.cssin the json list. I deleted rev-manifest.json and entered the command gulp. Now after opening rev-manifest.json all the css files are listed and the error is gone.
This seems pretty straightforward, but I can't seem to debug this error. I've added this code to my Sails API as /tasks/config/jshint.js
module.exports = function(grunt) {
console.log(1);
grunt.config.set('jshint', {
files: {
src: ['api/services/*.js', 'api/policies/*.js', 'api/controllers/*.js']
}
});
console.log(2);
grunt.loadNpmTask('grunt-contrib-jshint');
console.log(3);
};
Now, when I execute any grunt task, I get an error message (but the older tasks still execute successfully).
C:\dev\fo-rest-api>grunt aglio
1
2
Loading "Gruntfile.js" tasks...ERROR
>> TypeError: undefined is not a function
Running "aglio:your_target" (aglio) task
...
Done, without errors.
When I run the jshint task, I get the same loading error and the task is aborted.
C:\dev\fo-rest-api>grunt jshint
1
2
Loading "Gruntfile.js" tasks...ERROR
>> TypeError: undefined is not a function
Warning: Task "jshint" not found. Use --force to continue.
Aborted due to warnings.
C:\dev\fo-rest-api>
A few other notes:
Using --force only changes the wording of the error message.
grunt-contrib-jshint seems to be successfully installed in /node_modules (I deleted everything and re-ran npm install to be sure.
I'm running this on Windows, if that matters. I've tried opening the command line as both a normal user and as administrator.
I tried commenting out the loadNpmTask line to see if sails would load it automatically, but still got Warning: Task "jshint" not found.
Thanks for any clues you might have.
The answer was pretty straightforward. I somehow deleted the s at the end of grunt.loadNpmTasks. When I added it back, everything worked well.
I wish there was some sort of syntax highlighting that for common packages like grunt that would identify this kind of typo...
I followed the Yeoman tutorial to the T yet it doesn't work for me.
I'm getting this error:
C:\Users\Imray\Projects\myProj\v2>grunt serve
Loading "imagemin.js" tasks...ERROR
>> Error: Cannot find module 'rimraf'
Loading "watch.js" tasks...ERROR
>> Error: Cannot find module 'lodash'
Running "serve" task
Warning: Task "watch" not found. Use --force to continue.
Aborted due to warnings.
Execution Time (2014-12-14 15:38:18 UTC)
loading tasks 9ms ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 45%
serve 9ms ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 45%
Total 20ms
Any ideas why I am getting this error and how to overcome it?
Looks like you do not have the dependencies properly installed.
Do a npm install and bower install, after successfull completion try grunt serve again.