2017-08-12 59 views
-1

在前端,我想使用帶有Node.js和TypeScript的Angular 2,而在後端,我想使用Java。我正在嘗試使用Angular 2和NPM設置UI應用程序,之後我得到了一個示例應用程序。Angular 2安裝問題

但是,NPM正在拋出一堆來自常見軟件包的錯誤。 enter image description here

這裏是我的tsconfig.json:

{ 
    "compilerOptions": { 
    "target": "es5", 
    "module": "commonjs", 
    "moduleResolution": "node", 
    "emitDecoratorMetadata": true, 
    "experimentalDecorators": true, 
    "typeRoots": [ 
     "node_modules/@types" 
    ] 
    }, 
    "exclude": [ 
    "node_modules" 
    ] 
} 

這裏是我的typings.json:

{ 
    "dependencies": { 
    "bluebird": "registry:npm/bluebird#3.5.0+20170314181206", 
    "debug": "registry:npm/debug#2.0.0+20170504163145" 
    }, 
    "globalDependencies": { 
    "atom": "registry:env/atom#1.6.0+20160723033700", 
    "d3": "github:DefinitelyTyped/DefinitelyTyped/d3/d3.d.ts#1c05872e7811235f43780b8b596bfd26fe8e7760", 
    "mocha": "registry:dt/mocha#2.2.5+20170311011848", 
    "node": "registry:env/node#0.10.0+20170213133316" 
    } 
} 

此外,我讀的地方,分型已被棄用,但我無法找到一個替代它,這並不真正對我有好處。

回答

1

爲什麼不使用angular-cli來生成角度4的項目。這裏是鏈接:

  1. 安裝角CLI:您需要按照https://cli.angular.io/

    步驟

npm install -g @angular/cli 
  • 生成並投放Angular項目:
  • ng new my-project 
    cd my-project 
    ng serve 
    
  • 開放http://localhost:4200/在瀏覽器中
  • +0

    我不知道這是連一個選項。謝謝!我會嘗試把我的文件放在這個新項目中,看看它是否有效。 – jDub9