Tag: yeoman

在AngularJS应用程序中使用node_modules

我刚刚使用Yeoman项目生成器工具生成了一个angular度应用程序。 生成的项目有一个目录“node_modules”。 在这个模块里面有很多可能为array-diff等“预定义的函数”,而且我想在angularJS应用程序(控制器,指令)中使用这些函数。 我尝试过使用RequireJS和Node-Browserfy来使用这些node_modules,但没有成功,每次出现错误。 例如“filter不defiend等…”。 有没有一步一步的教程做这个模块集成到一个AngularJS应用程序? 我的项目结构是: 这是我的node.browswerfy生成的bundle.js (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ var myFilter =require('../../node_modules/array-filter/index.js'); },{"../../node_modules/array-filter/index.js":2}],2:[function(require,module,exports){ /** * Array#filter. * * @param {Array} arr * @param {Function} fn * @return {Array} */ module.exports = function (arr, fn) { […]

无法让Yeoman正常工作

我无法让Yeoman设置为我的生活工作。 当我尝试运行以下内容时: Aidans-MacBook-Pro:~ aidan$ npm install –global yo bower grunt-cli 但是,我最终得到以下(当我试图检查版本,只有Yeoman似乎被安装): npm WARN deprecated npmconf@2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm npm WARN checkPermissions Missing write access to /Users/aidan/.npm-packages/lib/node_modules/bower – minimatch@3.0.0 node_modules/yo/node_modules/glob/node_modules/minimatch – lru-cache@2.7.3 node_modules/yo/node_modules/minimatch/node_modules/lru-cache – sigmund@1.0.1 node_modules/yo/node_modules/sigmund /Users/aidan/.npm-packages/lib ├── bower@1.7.7 ├── grunt-cli@0.1.13 └─┬ […]

仪表板中的多个模块列表 – Yeoman MEANJS Generator

我是MEANJS的新手,有人build议我跟MEANJS一起开始kickstart应用程序。 我已经开始研究它,并试图为我的应用程序构build一个架构,但是如果我需要在交叉模块中工作,那么我会困惑一点,那就是架构是什么。 我想要的是我有2个CRUD模块文章和需要现在我想在我的仪表板(核心模块主页)上显示我的需求列表和文章列表。 请帮助我,我怎样才能沟通不同的模块。 应用程序是中等大小。 等待build议..

当从npm安装Yeoman时出现ENOENT错误

我正在尝试在cmd中使用以下命令来安装Yeoman: npm install –global yo 我得到以下内容: npm WARN deprecated npmconf@2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\{userdir}\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "–global" "yo" npm ERR! node v4.4.4 npm ERR! npm v3.9.0 npm ERR! path C:\{userDIr}\AppData\Roaming\npm\node_modules\yo\lib\cli.js npm ERR! code […]

如何使用webapp generator gulp构build非缩减的生产代码?

我用webapp生成器搭build了一个项目。 该项目只适用于本地主机,但不是如果我用文件scheme直接在浏览器中打开文件。 URL http://localhost:9000/打开app文件夹中的index.html文件,但http://localhost:9000/styles/main.css打开app../.tmp/styles/main.css 。 实际上,本地主机如何将一个目录返回到窗口栏中而不打开path。 这造成的问题是index.html使用bower_componnets/example.css文件夹与本地主机。 用文件scheme里面不存在应用程序内的bower_components文件夹。 所以我不能使用没有本地主机的app文件夹。 实际的问题是,我必须在服务器上传一个静态网页的工作演示,供后端开发者用来制作dynamic代码。 现在我无法上传应用程序文件夹,因为它只能在本地主机上运行。 随着gulp build我得到一个dist文件夹与文件计划,但它是全部缩小,不使用cdn。 后端开发人员不能使用缩小的html。 我浪费了两天的时间与g ye水手和webapp战斗。 我认为这将通过自动化任务来减less我的时间,并且我将着重于代码。 但是做了什么,我已经完全从实际工作中失去了重点,我正在集中精力在每一个小时后,用凉亭,npm,gulp来解决xyz问题。 相反,我花了5分钟的时间下载或findcdn的插件,并将它们手动包含在我的代码中,我将保存2天。 所以g b凉亭做了5分钟工作到2天工作。 多么辉煌的工具。 那么问题是: 如何使用webapp generator gulp构build一个类似于dist文件夹的非缩减生产代码? 编辑我的临时解决scheme 因为我们需要为我们的项目使用unminified html css和js文件,所以我在gulp文件中添加了一个新任务来生成类似于dist的demo文件夹。 我只是复制gulp.src('dist/**/*')任务,并将gulp.src('dist/**/*')改为gulp.src('demo/**/*') 。 为了这个任务生成样式和js文件夹中的文件,我添加了.pipe(gulp.dest('demo'))在.pipe(gulp.dest('dist')); }); .pipe(gulp.dest('dist')); }); 存在。 我也照顾把.pipe(gulp.dest('demo')); }); .pipe(gulp.dest('demo')); }); 在gulp使用minify任务之前。 这里是相关的gulp.js代码: // some code here gulp.task('html', ['styles', 'scripts'], () => { return gulp.src('app/*.html') […]

如何在我的angular度js应用程序中正确设置checklist-model指令?

我是一个noob与node.js /咕噜世界,所以我很抱歉,如果这个问题是非常愚蠢的… … – 我有一个与yeoman / grunt一起工作的angular.js项目,现在我想要做的就是包含一个指令,特别是这个指令, 但我不知道如何安装它! 我有: 在我的命令提示符下使用命令npm install checklist-model 链接index.html文件内的脚本 <script src='node_modules/checklist-model/checklist-model.js'></script> – 并在我的应用程序中添加依赖项 var app = angular.module('generaPreventivoApp', [ 'ngAnimate', 'ngCookies', 'ngResource', 'ngRoute', 'ngSanitize', 'checklist-model' ]); 控制台给我以下错误: Error: [$injector:modulerr] Failed to instantiate module app due to: [$injector:modulerr] Failed to instantiate module checklist-model due to: [$injector:nomod] Module 'checklist-model' is not available 我怎样才能正确设置?

Yeomanangular度开发环境与socket.io.js和NodeJS

我有一个angular色应用程序,在开发工作很好,在港口9000。 我有一个运行在端口3000上的服务器端node.js应用程序。 我已经在NodeJS应用程序上安装了socket.io。 我angular度应用程序中的大部分JS都在app目录中,但是socket.io.js通过节点提供: <script src="components/angular/angular.js"></script> <script src="components/angular-resource/angular-resource.js"></script> <script src="components/angular-cookies/angular-cookies.js"></script> <script src="components/angular-sanitize/angular-sanitize.js"></script> <script src="http://localhost:3000/socket.io/socket.io.js"></script> 这对我来说有点不对劲。 另外,当我加载socket.io并在客户端调用connect()时,它试图连接到localhost:9000,而不是localhost:3000 有没有办法调和这两个世界? 我是否需要在node.js中服务我的angular度应用程序? 我不愿意丢失活重装。

我想创build使用yeoman和骨干的示例应用程序,但显示一些错误任何人都可以帮助我吗?

我有alerady安装下面的东西在电脑 节点 NPM 自耕农 骨干发电机 ruby与萨斯和指南针 但在命令提示符下运行grunt命令时仍然显示以下错误。 C:\ Users \ Nirav \ Desktop \ Backbone \ NodeWebkit \ TestYeoman> grunt build运行“clean:dist”(clean)任务清理.tmp …确定 运行“咖啡:dist”(咖啡)任务 运行“咖啡:testing”(咖啡)任务 运行“createDefaultTemplate”任务 运行“jst:compile”(jst)任务 由于编译的文件是空的 运行“compass:dist”(指南针)任务C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:135:in require': cannot load such file — sass/script/node (LoadError) from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:135:in rescue in require'from C:/Ruby193/lib/ruby/site_ruby/1.9.1/ rubygems / core_ext / kernel_require.rb:144:in require' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches/browser_support.rb:1:in从C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in require' from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in require'from C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:2:in […]

哟webapp命令冻结(Windows 7)

在Ubuntuterminal中运行yo webapp没有任何问题。 但是,当我在Windows中运行它冻结在这一点上 问题:我如何解决这个问题 ,使它不会在图片中显示的地方冻结? PS:只是把这里的所有输出尝试运行yo webapp > output.txt但它停在第一个问题。 _—–_ | | |–(o)–| .————————–. `———´ | Welcome to Yeoman, | ( _´U`_ ) | ladies and gentlemen! | /___A___\ '__________________________' | ~ | __'.___.'__ ´ ` |° ´ Y ` Out of the box I include HTML5 Boilerplate, jQuery, and a Gruntfile.js to build your […]

自定义yeoman生成器的npmtesting失败

我已经build立了一个自定义的yeoman生成器。 你可以在https://github.com/abhishekoza/generator-ratchetfind代码。 当我尝试“npmtesting”,我得到以下错误 1 passing (454ms) 1 failing 1) ratchet generator creates expected files: Uncaught Error: You don't seem to have a generator with the name mocha:app installed. You can see available generators with npm search yeoman-generator and then install them with npm install [name]. To see the 1 registered generators run yo with the […]