GithubHelp home page GithubHelp logo

kolorobot / angular2-typescript-gulp Goto Github PK

View Code? Open in Web Editor NEW
120.0 11.0 70.0 3.91 MB

A basic Angular2 application with Gulp as build system.

License: MIT License

TypeScript 63.48% HTML 22.23% CSS 0.46% JavaScript 13.83%

angular2-typescript-gulp's Introduction

Angular2 with TypeScript and Gulp

A basic Angular2 application with Gulp as build system.

1. Prerequisites

nodejs must be installed on your system and the below global node packages must be installed:

  • gulp

npm i -g gulp

  • gulp-cli

npm i -g gulp-cli

  • typings

npm i -g [email protected]

  • typescript

npm i -g [email protected]

  • ts-node

npm i -g [email protected]

2. Cloning the repository

Clone the repository:

git clone https://github.com/kolorobot/angular2-typescript-gulp.git

Navigate to angular2-typescript-gulp directory:

cd angular2-typescript-gulp

3. Installing dependencies

Install dependencies by running the following command:

npm install

node_modules and typings directories will be created during the install.

4. Building the project

Build the project by running the following command:

npm run clean & npm run build

build directory will be created during the build

5. Starting the application

Start the application by running the following command:

npm start

The application will be displayed in the browser.

Resources

angular2-typescript-gulp's People

Contributors

ivanvs avatar kolorobot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular2-typescript-gulp's Issues

Faild to load external module ....

Hi, I wanted just to share with you that, if you add on package.json "ts-node": "^1.3.0", you will not get those errors. Or before you call

npm run clean & npm run build

call

npm install ts-node --save-dev

Run gulp file failed

Every task linked to gulp file failed with the following error :

npm run clean

> [email protected] clean /Users/kevin/Workspace/Angular2/angular2-typescript-gulp
> gulp clean

[19:55:03] Requiring external module ts-node/register
----------------------------------
⨯ Unable to compile TypeScript

gulpfile.ts (3,18): Cannot find module 'gulp'. (2307)
gulpfile.ts (4,17): Cannot find module 'del'. (2307)
gulpfile.ts (5,17): Cannot find module 'gulp-typescript'. (2307)
gulpfile.ts (6,24): Cannot find module 'gulp-sourcemaps'. (2307)
node_modules/gulp-tslint/index.d.ts (15,15): Cannot find name 'Buffer'. (2304)
----------------------------------

npm ERR! Darwin 15.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "clean"
npm ERR! node v5.6.0
npm ERR! npm  v3.6.0
npm ERR! code ELIFECYCLE
npm ERR! [email protected] clean: `gulp clean`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] clean script 'gulp clean'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the angular2-typescript-gulp package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     gulp clean
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs angular2-typescript-gulp
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls angular2-typescript-gulp
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/kevin/Workspace/Angular2/angular2-typescript-gulp/npm-debug.log

I can't follow your blog post with this error...

Thanks for your help

typings 1.x not supported

You have to restrict the required typings version to 0.x in package.json or restrict the required typings version to 1.0.x and rename ambientDependencies to globalDependencies in typings.json and change the 2nd line in main.ts to

///<reference` `path="../../typings/index.d.ts"/>.

.

License?

Hi,

I really like the job you have done with this project. There is only one little thing that I cannot find, license. So I was wondering, could you add some license to this project. May I suggest MIT license. If you don't add license project is licensed under property license, so it is not open source.

What do you think about that?

Issues when trying to build form scratch

Thanks for the nice tutorial on how to properly set up a nice project directory structure :) I have just cloned this repo and tried to install it. First I faced issues when running npm run clean:

...
[12:12:17] Failed to load external module ts-node/register
[12:12:17] Failed to load external module typescript-node/register
[12:12:17] Failed to load external module typescript-register
[12:12:17] Failed to load external module typescript-require
...

ts-node is installed globally, but it didn't work anyway. After installing it locally, It works: npm install ts-node. But now I got another issue:

[12:55:10] Requiring external module ts-node/register
TSError: ⨯ Unable to compile TypeScript
gulpfile.ts (3,14): Cannot find name 'require'. (2304)
gulpfile.ts (4,13): Cannot find name 'require'. (2304)
gulpfile.ts (5,13): Cannot find name 'require'. (2304)
gulpfile.ts (6,20): Cannot find name 'require'. (2304)
gulpfile.ts (8,16): Cannot find name 'require'. (2304)
src/app/main.ts (2,1): File '/home/chris/workspace/angular2-typescript-gulp/typings/browser/ambient/es6-shim/es6-shim.d.ts' not found. (6053)
    at getOutput (/home/chris/workspace/angular2-typescript-gulp/node_modules/ts-node/src/ts-node.ts:210:13)
    at Object.loader (/home/chris/workspace/angular2-typescript-gulp/node_modules/ts-node/src/ts-node.ts:225:23)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Module.require (module.js:466:17)
    at require (internal/module.js:20:19)
    at Liftoff.handleArguments (/home/chris/workspace/angular2-typescript-gulp/node_modules/gulp/bin/gulp.js:116:3)
    at Liftoff.<anonymous> (/home/chris/workspace/angular2-typescript-gulp/node_modules/liftoff/index.js:193:16)
    at module.exports (/home/chris/workspace/angular2-typescript-gulp/node_modules/flagged-respawn/index.js:17:3)

After I checked /typings/browser/amabient/es6-shim I noticed, that in fact, there was no es6-shim.d.ts file, but only an index.d.ts. So I changed the second line in main.ts from

///<reference path="../../typings/browser/ambient/es6-shim/es6-shim.d.ts"/>

to

///<reference path="../../typings/browser/ambient/es6-shim/index.d.ts"/>

But this just removed the file not found error - the "Cannot find name 'require'" still appears. Now I don't know what I could to further. I would appreciate any help to resolve this issue, but I think that it is not related to my system since I installed everything from scratch as shown in the README.md.

Best regards,
Chris

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.