I've been running through the gulp-angular generator.
Tried other answers by doing a complete uninstall of npm bower etc and reinstalling.
I do not get any errors when going through the generator but as soon as I try running 'gulp build', I keep getting this error
gulp build
[09:16:28] Using gulpfile ~/app/gulpfile.js
[09:16:28] Starting 'scripts'...
[09:16:28] Starting 'styles'...
[09:16:29] Starting 'partials'...
[09:16:29] Starting 'fonts'...
[09:16:29] Starting 'other'...
[09:16:29] gulp-inject 2 files into index.scss.
[09:16:30] Finished 'partials' after 1.28 s
[09:16:30] gulp-ruby-sass: directory
[09:16:30] gulp-ruby-sass: write index.css
write index.css.map
[09:16:30] all files 13.84 kB
[09:16:30] Finished 'scripts' after 2.08 s
[09:16:31] Finished 'styles' after 2.03 s
[09:16:31] Starting 'inject'...
[09:16:31] gulp-inject 1 files into index.html.
[09:16:31] Finished 'other' after 1.61 s
[09:16:31] Finished 'fonts' after 1.68 s
[09:16:31] gulp-inject 10 files into index.html.
[09:16:31] Finished 'inject' after 142 ms
[09:16:31] Starting 'html'...
[09:16:31] gulp-inject 1 files into index.html.
[09:16:31] dist/ maps/styles/app-070ae8ae0a.css.map 13.48 kB
[09:16:32] dist/ maps/styles/vendor-2a1d35e48e.css.map 273.03 kB
[09:16:33] dist/ maps/scripts/app-6e2669f540.js.map 14.81 kB
events.js:142
throw er; // Unhandled 'error' event
^
Error: scripts/vendor-70aa324478.js: error: couldn't process source due to parse error
Unexpected token (49992:4)
I thought it's in that file, script/vendor ... but I figured out that it was generated by gulp.
Here is my Gulp file.
/**
* Welcome to your gulpfile!
* The gulp tasks are splitted in several files in the gulp directory
* because putting all here was really too long
*/
'use strict';
var gulp = require('gulp');
var wrench = require('wrench');
/**
* This will load all js or coffee files in the gulp directory
* in order to load all gulp tasks
*/
wrench.readdirSyncRecursive('./gulp').filter(function(file) {
return (/\.(js|coffee)$/i).test(file);
}).map(function(file) {
require('./gulp/' + file);
});
/**
* Default task clean temporaries directories and launch the
* main optimization build task
*/
gulp.task('default', ['clean'], function () {
gulp.start('build');
});
Any guidance would be appreciated!
Thank you in advance
Related
Creating build of angularjs project inside folder dist /script I am not getting one script.js file.
I have tried grunt build --prod --force command for creating the build
Running "uglify:generated" (uglify) task
JS_Parse_Error {enter code here
message: 'Unexpected token: punc ())',
filename: '../../.tmp/concat/scripts/scripts.js',
line: 5122,
col: 59,
pos: 161138,
stack:
'Error\n at new JS_Parse_Error (D:\\...node_modules\\uglify-node_modules\\uglify-js\\lib\\parse.js:1427:20)' }
>> Uglifying source .tmp/concat/scripts/scripts.js failed.
Warning: Uglification failed.
Unexpected token: punc ()).
Line 5122 in .tmp/concat/scripts/scripts.jsenter code here
Used --force, continuing.
Warning: Cannot read property min of undefined Used --enter code hereforce, continuing.
Hi i'm building an app with gulp build command after a few seconds shows an error "angular is no defined" and several error more, this is the log :
{lamb} gulp build
[23:45:11] Requiring external module babel-register
[23:45:13] Using gulpfile C:\Apps\test\gulpfile.babel.js
[23:45:13] Starting 'lint'...
[23:45:14] Starting 'styles'...
[23:45:15] Starting 'scripts'...
[23:45:15] Starting 'images'...
[23:45:16] Starting 'fonts'...
[23:45:16] Starting 'extras'...
[23:45:16] Finished 'images' after 923 ms
[23:45:16] Finished 'fonts' after 90 ms
[23:45:16]
C:\Apps\test\app\scripts\main.js
3:10 error "angular" is not defined no-undef
5:34 error A space is required after ',' comma-spacing
9:12 error Extra space after key "controller" key-spacing
10:11 error Trailing spaces not allowed no-trailing-spaces
12:11 error Extra space after key "templateUrl" key-spacing
13:12 error Extra space after key "controller" key-spacing
16:10 error Extra space after key "templateUrl" key-spacing
17:12 error Extra space after key "controller" key-spacing
C:\Apps\test\app\scripts\controllers\controllerView.js
2:1 error "angular" is not defined no-undef
✖ 9 problems (9 errors, 0 warnings)
[23:45:16] 'lint' errored after 3.17 s
[23:45:16] ESLintError in plugin 'gulp-eslint'
Message:
Failed with 9 errors
[23:45:16] Finished 'styles' after 2.07 s
[23:45:16] Finished 'extras' after 609 ms
[23:45:16] Finished 'scripts' after 1.53 s
Add this to your .eslintrc file:
{
"globals": {
"angular": true
},
// ...
}
See the accepted answer for this question for more information:
ESLint's "no-undef" rule is calling my use of Underscore an undefined variable
So I installed all deps and and have been trying to use yo angular, and everything seems to complete alright, except that the resulting directory is empty after everything finishes.
Thoughts as to why?
leonsas at leonsas in ~/testdataops> yo angular dataops
_-----_
| | .--------------------------.
|--(o)--| | Welcome to Yeoman, |
`---------´ | ladies and gentlemen! |
( _´U`_ ) '--------------------------'
/___A___\
| ~ |
__'.___.'__
´ ` |° ´ Y `
Out of the box I include Bootstrap and some AngularJS recommended modules.
? Would you like to use Gulp (experimental) instead of Grunt? No
? Would you like to use Sass (with Compass)? Yes
? Would you like to include Bootstrap? Yes
? Would you like to use the Sass version of Bootstrap? Yes
? Which modules would you like to include? angular-animate.js, angular-cookies.js, angular-resource.js, angular-route.js, angular-sanitize.js, angular-touch.js
conflict app/styles/main.scss
? Overwrite app/styles/main.scss? overwrite
force app/styles/main.scss
conflict app/index.html
? Overwrite app/index.html? overwrite
force app/index.html
identical bower.json
identical .bowerrc
conflict package.json
? Overwrite package.json? overwrite
force package.json
identical Gruntfile.js
identical README.md
invoke angular:common:/Users/leonsas/.npm-packages/lib/node_modules/generator-angular/app/index.js
identical .editorconfig
identical .gitattributes
identical .jscsrc
identical .jshintrc
conflict .yo-rc.json
? Overwrite .yo-rc.json? overwrite
force .yo-rc.json
identical .gitignore
identical test/.jshintrc
identical app/404.html
identical app/favicon.ico
identical app/robots.txt
identical app/views/main.html
identical app/images/yeoman.png
invoke angular:main:/Users/leonsas/.npm-packages/lib/node_modules/generator-angular/app/index.js
conflict app/scripts/app.js
? Overwrite app/scripts/app.js? overwrite
force app/scripts/app.js
invoke angular:controller:/Users/leonsas/.npm-packages/lib/node_modules/generator-angular/app/index.js
conflict app/scripts/controllers/main.js
? Overwrite app/scripts/controllers/main.js? overwrite
force app/scripts/controllers/main.js
conflict test/spec/controllers/main.js
? Overwrite test/spec/controllers/main.js? overwrite
force test/spec/controllers/main.js
Just found a `.yo-rc.json` in a parent directory.
Setting the project root at: /Users/leonsas
invoke karma:app
I'm all done. Running bower install & npm install for you to install the required dependencies. If this fails, try running the command yourself.
invoke angular:route
invoke angular:controller:/Users/leonsas/.npm-packages/lib/node_modules/generator-angular/route/index.js
conflict app/scripts/controllers/about.js
? Overwrite app/scripts/controllers/about.js? overwrite
force app/scripts/controllers/about.js
conflict test/spec/controllers/about.js
? Overwrite test/spec/controllers/about.js? (Ynaxdh) conflict test/karma.conf.js
▌ ╢░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
? Overwrite test/spec/controllers/about.js? overwrite
force test/spec/controllers/about.js
? Overwrite test/karma.conf.js? overwrite
force test/karma.conf.js
conflict package.json
? Overwrite package.json? (Ynaxdh) invoke angular:view:/Users/leonsas/.npm-packages/lib/node_modules/generator-angular/route/index.js
? Overwrite package.json? overwrite
force package.json(Ynaxdh)
▌ ╢░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
dataops# /Users/leonsas
└── angular-bootstrap-starter#1.0.1 extraneous
Running "wiredep:app" (wiredep) task
Running "wiredep:test" (wiredep) task
Running "wiredep:sass" (wiredep) task
Done, without errors.
Execution Time (2016-02-24 02:18:38 UTC)
loading tasks 168ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 48%
loading grunt-wiredep 8ms ▇▇▇▇ 2%
wiredep:app 143ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 41%
wiredep:test 11ms ▇▇▇▇▇ 3%
wiredep:sass 20ms ▇▇▇▇▇▇▇▇ 6%
Total 351ms
dataops# /Users/leonsas
└── angular-bootstrap-starter#1.0.1 extraneous
leonsas at leonsas in ~/testdataops> ls
leonsas at leonsas in ~/testdataops> node -v
v5.6.0
leonsas at leonsas in ~/testdataops> npm -v
3.7.3
Is there a way to output protractor test results to a file to be viewed outside of the command line after a test is run, including seeing detailed failures?
I found a nice clean way of saving the test results in a orderly fashion using Jasmine reporter.
How to install and configure Jasmine reporter:
Install Jasmine reporter:
npm install -g jasmine-reporters
Add the following to the protractor-config.js file:
onPrepare: function() {
require('jasmine-reporters');
jasmine.getEnv().addReporter(
new jasmineReporters.JUnitXmlReporter('outputxmldir', true, true));
}
Create the outputxmldir folder (This is where all the test outputs will be placed).
Run protractor and now the results will be exported to an XML file in the outputxmldir folder.
Just the test output is enough?
protractor conf.js > test.log
Cheers.
You can also set the resultJsonOutputFile option in the config file:
export.config = {
(...)
// If set, protractor will save the test output in json format at this path.
// The path is relative to the location of this config.
resultJsonOutputFile:'./result.json',
(...)
}
More details about the config file can be found at:
https://raw.githubusercontent.com/angular/protractor/master/docs/referenceConf.js
I'm trying to run GAE tests on multiple packages. My app (testapp ) looks as below:
testapp>
README.md package1 package2
each package has two go files. One is the package itself the other is the 'test' package.
package1
$ls package1
package1.go package1_test.go
package2
$ls package2
package2.go package2_test.go
To run the tests I use
goapp test -v ./...
Output:
warning: building out-of-date packages:
github.com/mihai/API
installing these packages with 'go test -i ./...' will speed future tests.
=== RUN TestGetDiskFile
codelistgobfile.gob
codelist.gob written successfully
--- PASS: TestGetDiskFile (0.00 seconds)
PASS
ok testapp/package1 0.010s
However as you can see above it seems to run only the first test ( TestGetDiskFile ) from package1. After that it gets stuck. I get no kind of output. If I go in each package ( cd package 1 ) and run goapp test all the tests (about 20 tests) run successfully
Any idea how I can fix / run all the tests without getting stuck or at least how I can debug it further? is this a goapp bug?
I've tried on two different machines ( Mac osx , and ubuntu ), the result is same.
To debug, strip things down to a minimal test case. For example, the following is a minimal test case for go test -v ./.... Try something similar for goapp test -v ./....
$ dir
package1 package2
$ tree ../packages
../packages
├── package1
│ └── package1_test.go
└── package2
└── package2_test.go
2 directories, 2 files
$ go test -v ./...
=== RUN TestPackage1
--- PASS: TestPackage1 (0.00 seconds)
PASS
ok packages/package1 0.004s
=== RUN TestPackage2
--- PASS: TestPackage2 (0.00 seconds)
PASS
ok packages/package2 0.004s
$
File: package1_test.go:
package package1
import "testing"
func TestPackage1(t *testing.T) {}
File: package2_test.go:
package package2
import "testing"
func TestPackage2(t *testing.T) {}