Yo
D:\Projects\mallspk>grunt serve
Running "serve" task
Running "clean:server" (clean) task
>> 0 paths cleaned.
Running "wiredep:app" (wiredep) task
Running "wiredep:test" (wiredep) task
Running "wiredep:sass" (wiredep) task
Running "concurrent:server" (concurrent) task
Warning: Running "compass:server" (compass) task
Warning: Command failed: 'compass.bat' is not recognized as an internal or exter
nal command,
operable program or batch file.
Use --force to continue.
I have install the Yo angular
and runs the followings commands:
npm install grunt --save-dev
npm install -g grunt-contrib-compass
npm install -g compass
npm install
bower install
npm install grunt-google-cdn
and when i run the command grunt serve
i have got this error. i have latest node and npm install with latest grunt and yo.
Source: (StackOverflow)
I try to get an asp.Net 5 mvc running under mono. For the first steps i try to run an Application Template from yo
My Steps are :
yo aspnet
<- choose WebApplication with name MyWeb
cd MyWeb
kpm restore --source https://www.myget.org/F/aspnetvnext/api/v2/
<- done without errors
kpm build
after that command i got the following errors:
/home/dev/WORKSPACE/MyWeb/MyWeb/Startup.cs(29,16): error CS0246: The type or namespace name 'IConfiguration' could not be found (are you missing a using directive or an assembly reference?)
/home/dev/WORKSPACE/MyWeb/MyWeb/Startup.cs(32,39): error CS0246: The type or namespace name 'IServiceCollection' could not be found (are you missing a using directive or an assembly reference?)
/home/dev/WORKSPACE/MyWeb/MyWeb/Startup.cs(59,56): error CS0246: The type or namespace name 'IHostingEnvironment' could not be found (are you missing a using directive or an assembly reference?)
/home/dev/WORKSPACE/MyWeb/MyWeb/Startup.cs(59,81): error CS0246: The type or namespace name 'ILoggerFactory' could not be found (are you missing a using directive or an assembly reference?)
/home/dev/WORKSPACE/MyWeb/MyWeb/Startup.cs(21,24): error CS0246: The type or namespace name 'IHostingEnvironment' could not be found (are you missing a using directive or an assembly reference?)
/home/dev/WORKSPACE/MyWeb/MyWeb/Models/IdentityModels.cs(21,37): error CS0246: The type or namespace name 'IHostingEnvironment' could not be found (are you missing a using directive or an assembly reference?)
/home/dev/WORKSPACE/MyWeb/MyWeb/Startup.cs(24,29): error CS0012: The type 'IConfigurationSourceContainer' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Framework.ConfigurationModel.IConfigurationSourceContainer, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
/home/dev/WORKSPACE/MyWeb/MyWeb/Startup.cs(40,17): error CS0012: The type 'IServiceCollection' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Framework.DependencyInjection.IServiceCollection, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
/home/dev/WORKSPACE/MyWeb/MyWeb/Startup.cs(46,13): error CS0012: The type 'IServiceCollection' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Framework.DependencyInjection.IServiceCollection, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
/home/dev/WORKSPACE/MyWeb/MyWeb/Startup.cs(50,13): error CS0012: The type 'IServiceCollection' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Framework.DependencyInjection.IServiceCollection, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
/home/dev/WORKSPACE/MyWeb/MyWeb/Startup.cs(63,13): error CS0012: The type 'ILoggerFactory' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Framework.Logging.ILoggerFactory, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
this is my project.json:
{
/* Click to learn more about project.json http://go.microsoft.com/fwlink/?LinkID=517074 */
"webroot": "wwwroot",
"version": "1.0.0-*",
"dependencies": {
"EntityFramework.SqlServer": "7.0.0-beta3",
"EntityFramework.Commands": "7.0.0-beta3",
"Microsoft.AspNet.Mvc": "6.0.0-beta3",
/* "Microsoft.AspNet.Mvc.WebApiCompatShim": "6.0.0-beta3", */
"Microsoft.AspNet.Diagnostics": "1.0.0-beta3",
"Microsoft.AspNet.Diagnostics.Entity": "7.0.0-beta3",
"Microsoft.AspNet.Identity.EntityFramework": "3.0.0-beta3",
"Microsoft.AspNet.Security.Cookies": "1.0.0-beta3",
"Microsoft.AspNet.Server.IIS": "1.0.0-beta3",
"Microsoft.AspNet.Server.WebListener": "1.0.0-beta3",
"Microsoft.AspNet.StaticFiles": "1.0.0-beta3",
"Microsoft.Framework.ConfigurationModel.Json": "1.0.0-beta3",
"Microsoft.Framework.CodeGenerators.Mvc": "1.0.0-beta3",
"Microsoft.Framework.Logging": "1.0.0-beta3",
"Microsoft.Framework.Logging.Console": "1.0.0-beta3",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-beta3",
/* Modifications for Mono Support*/
"EntityFramework.InMemory": "7.0.0-beta3",
"Kestrel": "1.0.0-beta3"
},
"commands": {
/* Change the port number when you are self hosting this application */
"web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5001",
"kestrel": "Microsoft.AspNet.Hosting --server Kestrel --server.urls http://localhost:5004",
"gen": "Microsoft.Framework.CodeGeneration",
"ef": "EntityFramework.Commands"
},
"frameworks": {
"aspnet50": {},
"aspnetcore50": {}
},
"exclude": [
"wwwroot",
"node_modules",
"bower_components"
],
"bundleExclude": [
"node_modules",
"bower_components",
"**.kproj",
"**.user",
"**.vspscc"
],
"scripts": {
"postrestore": ["npm install"],
"prepare": ["grunt bower:install"]
}
}
Used Versions are:
Mono JIT compiler version 3.12.0 (tarball Sat Feb 7 19:13:43 UTC 2015)
KRE: 1.0.0-beta4-11166
Seems like something is wrong with Microsoft.Framework.ConfigurationModel but running out of ideas how to fix this. I hope someone can give me an hint to point me in the right direction!
Thanks a lot for reading!
Regards Alex
Source: (StackOverflow)
How can I override the Bootstrap variables if I don't want to touch the Bower files?
I am using Yo, Grunt, and Bower. For yo, I am using cg-angular.
My app.less looks like this:
@import "bower_components/bootstrap/less/bootstrap.less";
@import "bower_components/font-awesome/less/font-awesome.less";
@fa-font-path: "bower_components/font-awesome/fonts";
....
Source: (StackOverflow)
My node started to behave odd. So I removed it and installed it again. Now, I cant runt grunt serve
anymore
Pers-MacBook-Air:clientMD perstrom$ grunt serve
Running "serve" task
Running "clean:server" (clean) task
>> 0 paths cleaned.
Running "wiredep:app" (wiredep) task
Running "wiredep:test" (wiredep) task
Running "wiredep:sass" (wiredep) task
Running "concurrent:server" (concurrent) task
Warning: Running "compass:server" (compass) task
Error: invalid option: --import-path=./bower_components
Usage: compass compile [path/to/project] [path/to/project/src/file.sass ...] [options]
Description:
compile project at the path specified or the current director if not specified.
I've generated the project with yo angular
. It worked before I reinstalled node.
Source: (StackOverflow)
In the scaffold generated project using yo angular fullstack I normally launch the app with grunt using grunt (I am not an expert on it).
Example
grunt
grunt serve
and so on.
As far as I know I have three different environments (Development, Test, Production). Every time I need to change I have to go to the main file changing the correct line (default is Development).
How can choose one of them from terminal? I am completely sure there has to be way to do that from grunt...
I can imagine it has to be something like
grunt serve --env:prod
grunt serve --test
grunt serve development
I have tried all of them but nothing, I have been spending some time trying to figure it out this from the Gruntfile but I cannot find neither googling.
Does anyone know how to do that? Any help would be appreciated
Source: (StackOverflow)
yo angular
install bootstrap files all fine. The index.html
file looks like this at the moment:
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
<!-- build:css(.) styles/vendor.css -->
<!-- bower:css -->
<link rel="stylesheet" rel='nofollow' href="bower_components/bootstrap/dist/css/bootstrap.css" />
<!-- endbower -->
<!-- endbuild -->
<!-- build:css(.tmp) styles/main.css -->
<link rel="stylesheet" rel='nofollow' href="styles/main.css">
<!-- endbuild -->
This doesn't include bootstrap.theme.css
file.
What is the recommended way of adding this? Do I manually go in there and add it?
Source: (StackOverflow)
I'm trying to set up yo to use the angular generator for a project. I am following the steps detailled here: http://yeoman.io/learning/index.html
I already have Node.js and NPM installed.
But when I use the command:
sudo npm install -g yo bower grunt-cli
It fails and I get this error:
> spawn-sync@1.0.11 postinstall /usr/lib/node_modules/yo/node_modules/cross-spawn/node_modules/spawn-sync
> node postinstall
fs.js:439
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: EACCES, permission denied '/usr/lib/node_modules/yo/node_modules/cross-spawn/node_modules/spawn-sync/package.json'
at Object.fs.openSync (fs.js:439:18)
at Object.fs.writeFileSync (fs.js:978:15)
at Object.<anonymous> (/usr/lib/node_modules/yo/node_modules/cross-spawn/node_modules/spawn-sync/postinstall.js:20:6)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:935:3
npm ERR! Linux 3.13.0-24-generic
npm ERR! argv "node" "/usr/bin/npm" "install" "-g" "yo"
npm ERR! node v0.10.37
npm ERR! npm v2.11.0
npm ERR! code ELIFECYCLE
npm ERR! spawn-sync@1.0.11 postinstall: `node postinstall`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the spawn-sync@1.0.11 postinstall script 'node postinstall'.
npm ERR! This is most likely a problem with the spawn-sync package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node postinstall
npm ERR! You can get their info via:
npm ERR! npm owner ls spawn-sync
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/vincent/npm-debug.log
I tried to use chmod 777 on /usr/lib/node_modules
but it doesn't seem to work better.
I can install Bower and Grunt, it worked, but when I try to install Yo, it fails everytime...
I have no idea what to do as everything I tried using chmod
or chown
didn't work.
Thanks for your help guys! :)
Source: (StackOverflow)
I am new to Angular, ui-router and generator-ng-poly and am hoping someone can help with what is likely a simple syntax issue.
I am using generator-ng-poly for a new project and working from the "Deep Level Example" with an Angular 1.3 based app using ui-router and HTML.
First I created a "home" module, then a "header" module inside that. So...
yo ng-poly:module home
yo ng-poly:module home/header
Which gives me these two controllers:
app/home/home.js
(function () {
'use strict';
/* @ngdoc object
* @name home
* @requires $stateProvider
*
* @description
*
*/
angular
.module('home', [
'ui.router',
'home.header'
]);
angular
.module('home')
.config(config);
function config($stateProvider) {
$stateProvider
.state('home', {
url: '/home',
templateUrl: 'home/home.tpl.html',
controller: 'HomeCtrl',
controllerAs: 'home'
});
}
})();
and
app/home/header/header.js
(function () {
'use strict';
/* @ngdoc object
* @name home.header
* @requires $stateProvider
*
* @description
*
*/
angular
.module('home.header', [
'ui.router'
]);
angular
.module('home.header')
.config(config);
function config($stateProvider) {
$stateProvider
.state('header', {
url: '/header',
templateUrl: 'home/header/header.tpl.html',
controller: 'HeaderCtrl',
controllerAs: 'header'
});
}
})();
Now I want to use the "header" from within home.tpl.html and I am struggling with how to do this. From what I understand either
<div ui-view=“header”></div>
or
<div ui-view=“home.header”></div>
should work. But neither is. Hours of Googling has not helped since all the examples use the more common $stateProvider format where there are chained states like so:
$stateProvider
.state('home', {
url: '/home',
templateUrl: 'home/home.tpl.html',
controller: 'HomeCtrl',
controllerAs: 'home'
})
.state('home.header', {
url:'/header',
templateUrl: 'home/header/header.tpl.html',
controller: 'header/header-controller.js',
controllerAs: 'header'
});
How should I be referencing "header" to have it show up properly inside home.tpl.html?
Source: (StackOverflow)
I had added another module 'checklist-model' which is able to load with a similar configuration.
Error:
Uncaught Error: [$injector:modulerr] Failed to instantiate module
mmxDashboardApp due to: Error: [$injector:modulerr] Failed to
instantiate module angular-gridster due to: Error: [$injector:nomod]
Module 'angular-gridster' is not available! You either misspelled the
module name or forgot to load it. If registering a module ensure that
you specify the dependencies as the second argument.
Bower.json
{
"name": "mmx-dashboard",
"version": "0.0.0",
"dependencies": {
"angular": ">=1.2.*",
"json3": "~3.3.1",
"es5-shim": "~3.0.1",
"jquery": "~1.11.0",
"bootstrap": "~3.1.1",
"angular-resource": ">=1.2.*",
"angular-cookies": ">=1.2.*",
"angular-sanitize": ">=1.2.*",
"angular-route": ">=1.2.*",
"angular-bootstrap": "~0.11.0",
"font-awesome": ">=4.1.0",
"lodash": "~2.4.1",
"checklist-model" : "~0.2.4",
"nvd3" : ">=1.7.1",
"angular-gridster" : "~0.11.7"
},
"devDependencies": {
"angular-mocks": ">=1.2.*",
"angular-scenario": ">=1.2.*"
}
}
app.js
'use strict';
angular.module('mmxDashboardApp', [
'ngCookies',
'ngResource',
'ngSanitize',
'ngRoute',
'ui.bootstrap',
'checklist-model',
'angular-gridster'
])
.config(function ($routeProvider, $locationProvider) {
$routeProvider
.otherwise({
redirectTo: '/'
});
$locationProvider.html5Mode(true);
});
index.html
<!-- bower:js -->
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-resource/angular-resource.js"></script>
<script src="bower_components/angular-cookies/angular-cookies.js"></script>
<script src="bower_components/angular-sanitize/angular-sanitize.js"></script>
<script src="bower_components/angular-route/angular-route.js"></script>
<script src="bower_components/angular-bootstrap/ui-bootstrap-tpls.js"></script>
<script src="bower_components/lodash/dist/lodash.compat.js"></script>
<script src="bower_components/checklist-model/checklist-model.js"></script>
<script src="bower_components/d3/d3.js"></script>
<script src="bower_components/nvd3/build/nv.d3.js"></script>
<script src="bower_components/javascript-detect-element-resize/detect-element-resize.js"></script>
<script src="bower_components/angular-gridster/src/angular-gridster.js"></script>
<!-- endbower -->
Source: (StackOverflow)
I have forked a Yomen generator and changed it a little bit, npm link
works great.
I don't know how to publish my generator, It's already on Github.
How can i publish this generator so it can be installed by npm install -g generator-name
?
Source: (StackOverflow)
I have tried installing yo anugular
and got below error, I have tried updating node
, npm
, npm cache clean
etc. but its not working.
When I ran $ yo angular
it goes and fetch dependencies using bower
but its gives this error and move on
npm WARN engine karma@0.12.31: wanted: {"node":"~0.8 || ~0.10"} (current: {"node":"0.12.0","npm":"2.5.0"})
...
> phantomjs@1.9.15 install
/Users/jhondoe/Desktop/webapp/node_modules/karma-phantomjs-launcher/node_modules/phantomjs
> node install.js
Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-macosx.zip
Saving to /var/folders/vy/sc6v8frj4d3gprgzdpfcjhkm0000gn/T/phantomjs/phantomjs-1.9.8-macosx.zip
Receiving...
npm ERR! Darwin 13.0.0---------------------] 37% 0.0s|
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.12.0
npm ERR! npm v2.5.0
npm ERR! null == true
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <http://github.com/npm/npm/issues>
[=======================================-] 98% 0.0s
Received 9187K total.
Extracting zip contents
and after that on more error and some warning
npm WARN unmet dependency /Users/jhondoe/Desktop/webapp/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob requires minimatch@'0.3' but will load
and error
> pngquant-bin@2.0.3 postinstall
/Users/jhondoe/Desktop/webapp/node_modules/grunt-contrib-imagemin/node_modules/imagemin/node_modules/imagemin-pngquant/node_modules/pngquant-bin
> node lib/install.js
✔ pngquant pre-build test passed successfully
npm ERR! Please include the following file with any support request:
npm ERR! /Users/jhondoe/Desktop/webapp/npm-debug.log
Loading "cssmin.js" tasks...ERROR
>> Error: Cannot find module 'pako/lib/zlib/messages'
Loading "uglify.js" tasks...ERROR
>> Error: Cannot find module 'pako/lib/zlib/messages'
after that it fails saying below msg
Loading "cssmin.js" tasks...ERROR
>> Error: Cannot find module 'pako/lib/zlib/messages'
Loading "uglify.js" tasks...ERROR
>> Error: Cannot find module 'pako/lib/zlib/messages'
...
Running "karma:unit" (karma) task
INFO [karma]: Karma v0.12.31 server started at http://localhost:8080/
INFO [launcher]: Starting browser PhantomJS
WARN [watcher]: Pattern "/Users/jhondoe/Desktop/webapp/test/mock/**/*.js" does not match any file.
INFO [PhantomJS 1.9.8 (Mac OS X)]: Connected on socket jYytgLM38t_yiNPOWqbq with id 15305149
PhantomJS 1.9.8 (Mac OS X): Executed 2 of 2 SUCCESS (0.004 secs / 0.02 secs)
Warning: Task "cssmin" not found. Use --force to continue.
Aborted due to warnings.
I am banging my head from 6 hrs, please help how can i fix it.
my Node version is v0.12.0
NPM is 2.5.0
and OSX 10.9
Source: (StackOverflow)
I'm very familiar with yo angular (fullstack) apps, and so I expected the yo jhipster app scaffolding to perform in a similar way.
So, I'm running a new project using jhipster. I've installed everything, built my app with maven, created an entity, and started up the app with grunt serve
it just hangs forever.
So, popping open the developer console, i'm seeing that there are no JS errors, and the initial page's GET request is just pending forever.
Three questions immediately come to mind:
- what should I be seeing?
- is there a reason why the url wont resolve to anything?
- what do I do to load & view the app correctly?
Source: (StackOverflow)
I am trying to generate a WebApp using Yeoman Yo
Command but I keep getting following error:
pdclap-2stjvs1:ShippingSolutionPlain administrator$ yo webapp
Error: Cannot find module './lib/env'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/usr/local/lib/node_modules/generator-webapp/node_modules/yeoman-generator/index.js:7:19)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
pdclap-2stjvs1:ShippingSolutionPlain administrator$
Is it an environment variable issue?
Source: (StackOverflow)
gulpfile.js
'use strict';
var gulp = require('gulp');
gulp.paths = {
src: 'src',
dist: 'dist',
tmp: '.tmp',
e2e: 'e2e'
};
require('require-dir')('./gulp');
gulp.task('build', ['clean'], function () {
gulp.start('buildapp');
});
gulp/server.js
'use strict';
var gulp = require('gulp');
var paths = gulp.paths;
var util = require('util');
var browserSync = require('browser-sync');
var middleware = require('./proxy');
function browserSyncInit(baseDir, files, browser) {
browser = browser === undefined ? 'default' : browser;
var routes = null;
if(baseDir === paths.src || (util.isArray(baseDir) && baseDir.indexOf(paths.src) !== -1)) {
routes = {
'/bower_components': 'bower_components'
};
}
browserSync.instance = browserSync.init(files, {
startPath: '/',
server: {
baseDir: baseDir,
middleware: middleware,
routes: routes
},
browser: browser
});
}
gulp.task('serve', ['watch'], function () {
browserSyncInit([
paths.tmp + '/serve',
paths.src,
], [
paths.tmp + '/serve/{app,components}/**/*.css',
paths.src + '/{app,components}/**/*.js',
paths.src + 'src/assets/images/**/*',
paths.tmp + '/serve/*.html',
paths.tmp + '/serve/{app,components}/**/*.html',
paths.src + '/{app,components}/**/*.html'
]);
});
gulp.task('serve:dist', ['buildapp'], function () {
browserSyncInit(paths.dist);
});
gulp.task('serve:e2e', ['inject'], function () {
browserSyncInit([paths.tmp + '/serve', paths.src], null, []);
});
gulp.task('serve:e2e-dist', ['buildapp'], function () {
browserSyncInit(paths.dist, null, []);
});
node version: v0.10.25
npm version: 1.3.10
gulp CLI and Local version: 3.9.0
OS: Ubuntu 14.04.2 LTS
I also install all node packages correctly and no errors. But if I run gulp serve
I get the Error: spawn EACCES
I clearly uninstalled node, npm, bower, gulp etc. and installed them back already but it doesn't solved the problem.
Here's the whole error log when I run gulp serve
:
[22:15:33] Using gulpfile /media/culaste/Data/Code/sampleapp/source/gulpfile.js
[22:15:33] Starting 'styles'...
[22:15:34] gulp-inject 26 files into app.scss.
[22:15:34] Finished 'styles' after 1.24 s
[22:15:34] Starting 'inject'...
[22:15:34] gulp-inject 1 files into 404.tmpl.html.
[22:15:34] gulp-inject 1 files into 500.tmpl.html.
[22:15:35] gulp-inject 1 files into index.html.
[22:15:35] gulp-inject 105 files into 404.tmpl.html.
[22:15:35] gulp-inject 105 files into 500.tmpl.html.
[22:15:35] gulp-inject 105 files into index.html.
[22:15:35] Finished 'inject' after 668 ms
[22:15:35] Starting 'watch'...
[22:15:36] Finished 'watch' after 1.19 s
[22:15:36] Starting 'serve'...
[22:15:36] Finished 'serve' after 94 ms
[BS] Local URL: http://localhost:3000/
[BS] External URL: http://192.168.8.101:3000/
[BS] Serving files from: .tmp/serve
[BS] Serving files from: src
[BS] Watching files...
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn EACCES
at errnoException (child_process.js:988:11)
at Process.ChildProcess._handle.onexit (child_process.js:779:34)
Source: (StackOverflow)