我知道.gitignore文件隐藏了Git版本控制中指定的文件.我有一个项目(LaTeX),它在运行时会生成许多额外的文件(.auth,.dvi,.pdf,日志等),但我不希望这些文件被跟踪.
我知道我可以(也许应该)这样做所有这些文件放在项目中的一个单独的子文件夹中,因为我可以忽略该文件夹.
但是,有没有可行的方法将输出文件保存在项目树的根目录中,并使用.gitignore忽略除了我用Git跟踪的文件之外的所有内容?就像是
# Ignore everything
*
# But not these files...
script.pl
template.latex
# etc...
Run Code Online (Sandbox Code Playgroud) 问题1:
通过npm安装Twitter Bootstrap的目的究竟是什么?我认为npm是用于服务器端模块的.自己提供引导程序文件比使用CDN更快吗?
问题2:
如果我是npm安装Bootstrap,我将如何指向bootstrap.js和bootstrap.css文件?
我想知道我们是否应该在我们的仓库中跟踪node_modules或在检查代码时进行npm安装?
我即将尝试我的第一个AngularJS项目,并且将Node.js用于后端是有意义的,即使这意味着同时从头开始学习AngularJS和Node.js.
我试图弄清楚的第一件事是一个好的文件结构.到目前为止,我的纯HTML/CSS模板具有以下目录结构......
_site/
Fonts/
Javascript/
SASS/
Stylesheets/
Index.html
Run Code Online (Sandbox Code Playgroud)
(_site是PSD等的工作目录)
我发现了一个例子目录结构使Node.js/AngularJS应用在这里 ....
...这表明以下目录结构.
app.js --> Application configuration
package.json --> For npm
public/ --> All of the files to be used in on the client side
css/ --> CSS files
app.css --> Default stylesheet
img/ --> Image files
js/ --> JavaScript files
app.js --> Declare top-level application module
controllers.js --> Application controllers
directives.js --> Custom AngularJS directives
filters.js --> Custom AngularJS filters
services.js --> Custom AngularJS services
lib/ --> AngularJS and …Run Code Online (Sandbox Code Playgroud) npm允许我们指定bundledDependencies但这样做有什么好处?我想如果我们想要确保我们得到正确的版本,即使我们引用的模块被删除,或者捆绑可能有速度优势?
有人知道bundledDependencies优于普通依赖关系的优势吗?
为方便起见,在这里提取bundledDependencies定义:
bundledDependencies
发布包时将捆绑的包名称数组.如果这拼写为"bundleDependencies",那么这也是光荣的.
例如
bundledDependencies
我在C:\ Program Files(x86)\nodejs中安装了nodejs
然后我创建了一个.js文件并将其保存在我的桌面上,只是为了在控制台中输出'hello world':
console.log('hello world');
Run Code Online (Sandbox Code Playgroud)
当我尝试从命令提示符运行该文件时:
C:\Users\Laura>cd desktop
C:\Users\Laura\Desktop>node nodeTest.js
Run Code Online (Sandbox Code Playgroud)
我明白了:
module.js:340
throw err;
^
Error: Cannot find module 'C:\Users\Laura\Desktop\testNode.js'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:901:3
Run Code Online (Sandbox Code Playgroud)
我读了许多其他相关的问题,其中一些建议运行安装,所以我做了.
C:\Users\Laura>npm install -g express
Run Code Online (Sandbox Code Playgroud)
但没有运气,仍然得到相同的错误信息.
检查node_module是社区标准,但现在我们还可以选择使用shrinkwrap.后者对我来说更有意义,但总有可能有人"强制发布"并引入了一个错误.还有其他缺点吗?
我是Node的新手,但到目前为止我很开心.我试图将我的node_modules(库)目录移到公共'webroot'之外,需要建议和指导.
我已经设置了基于expressJS的简单Node项目,如下所示:
/my_project
/config
/public
/node_modules
server.js
Run Code Online (Sandbox Code Playgroud)
我想知道是否有任何方法可以让/node_modules我的webroot之外的目录,而不是破坏我的应用程序.我只是习惯于在公开暴露的webroot中保持最低限度,并且感觉不适合使用libs.叫我老式,但这就是我习惯在PHP和C#世界中做的事情.
如果我按如下方式设置项目:
/my_project
/config
/node_modules
/public
server.js
Run Code Online (Sandbox Code Playgroud)
然后一切都摇摇晃晃,Node的require()神奇中断了.
我尝试过以下方法:
var express=require('../express'); 哪个不起作用要么给我'无法查找模块'类型错误.
我知道NuGet软件包(至少在现在是这样)不应该包含在版本控制中。如何排除软件包添加到项目中的文件?
例如:我有一个使用引导NuGet包的.NET MVC项目。它将一些CSS,JS和字体文件分别添加到Content,Scripts和字体。这些文件应该包含在我的源代码管理中吗?如果不是,那么忽略它们的最佳方法是什么?(我正在此特定项目上使用GIT。)
我是Azure和Angular2的新手.
目标
使用GitHub设置Azure持续部署.
问题
Azure正在获取存储库主分支的提交.所以这部分还可以.但是,由于生成错误,部署失败.
这是部署详细信息:
这是完整的日志:
Command: "D:\home\site\deployments\tools\deploy.cmd"
Handling .NET Web Application deployment.
MSBuild auto-detection: using msbuild version '14.0' from 'D:\Program Files (x86)\MSBuild\14.0\bin'.
All packages listed in packages.config are already installed.
D:\home\site\repository\LearnJS\LearnJS.Web\app\app.component.ts(1,41): error TS2307: Build: Cannot find module 'angular2/core'. [D:\home\site\repository\LearnJS\LearnJS.Web\LearnJS.Web.csproj]
D:\home\site\repository\LearnJS\LearnJS.Web\app\app.component.ts(2,46): error TS2307: Build: Cannot find module 'angular2/router'. [D:\home\site\repository\LearnJS\LearnJS.Web\LearnJS.Web.csproj]
D:\home\site\repository\LearnJS\LearnJS.Web\app\crisis-form.component.ts(1,25): error TS2307: Build: Cannot find module 'angular2/core'. [D:\home\site\repository\LearnJS\LearnJS.Web\LearnJS.Web.csproj]
D:\home\site\repository\LearnJS\LearnJS.Web\app\crisis-form.component.ts(2,22): error TS2307: Build: Cannot find module 'angular2/common'. [D:\home\site\repository\LearnJS\LearnJS.Web\LearnJS.Web.csproj]
D:\home\site\repository\LearnJS\LearnJS.Web\app\crisis.component.ts(1,33): error TS2307: Build: Cannot find module 'angular2/core'. [D:\home\site\repository\LearnJS\LearnJS.Web\LearnJS.Web.csproj]
D:\home\site\repository\LearnJS\LearnJS.Web\app\crisis.component.ts(2,30): error TS2307: …Run Code Online (Sandbox Code Playgroud)