我想創建一個角2應用的Visual Studio 2017年採用了棱角分明2
下面是打字稿代碼
import { Component } from 'angular2/core';
@Component({
selector: 'my-app',
template: ' <h1> My First SharePoint Add In using Angular2... !!! < /h1>'
})
export class AppComponent { }
它拋出下面的錯誤
拋出編譯錯誤打字稿文件找不到模塊angular2/core
修飾器的實驗支持是一個功能,在未來的版本
O更改對於第二個錯誤,我也於tsconfig.json
我還安裝了TypeScript SDK for Visual Studio 2017並重新啓動Visual Studio中添加
"experimentalDecorators": true,
,但沒有運氣
我也試過npm install -g [email protected]
下面是m Ÿ的package.json
{
"name": "imageslideshow",
"version": "1.0.0",
"description": "slide show for image libraries",
"main": "index.js",
"dependencies": {
"@angular/core": "^4.3.2",
"angular2": "^2.0.0-beta.17",
"es6-promise": "^4.1.1",
"es6-shim": "^0.35.3",
"reflect-metadata": "^0.1.2",
"rxjs": "^5.0.0-beta.6",
"systemjs": "^0.20.17",
"zone.js": "^0.8.16"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "vignesh",
"license": "ISC"
}
嘗試運行 '故宮安裝' –
是的,我試過'NPM安裝-g打字稿@ latest' –
不NPM安裝-g,但只是npm安裝在你的解決方案或其子目錄中,你有你的軟件包 –