创建tsconfig.json文件时出错

时间:2017-12-14 06:40:47

标签: angular tsc tsconfig

我正在尝试通过自己安装所需的依赖项来创建自定义的Angular项目。我可以创建package.json& package-lock.json个文件。现在我尝试使用

在项目目录中添加tscconfig.json文件
tsc-init

但是我收到以下错误:

PS E:\Angular Projects\starter-project> tsc-init
Installing packages. This might take a couple minutes.

npm WARN starter-project@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm WARN starter-project@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

Creating tsconfig.json
child_process.js:644
    throw err;
    ^

Error: Command failed: tsc --init
    at checkExecSyncError (child_process.js:601:13)
    at execSync (child_process.js:641:13)
    at Object.<anonymous> (C:\Users\Saigal 
    PC\AppData\Roaming\npm\node_modules\tsc-init\index.js:72:3)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Function.Module.runMain (module.js:676:10)
    at startup (bootstrap_node.js:187:16)

这是我的package.json文件: package.json

{
  "name": "starter-project",
  "version": "1.0.0",
  "description": "Starter project by customized installation of 
   dependencies!!!",
  "main": "index.js",
  "scripts": {
  "test": "echo \"Error: no test specified\" && exit 1"
},
  "author": "Saigal Amatya",
  "license": "ISC",
  "dependencies": {
  "@angular/common": "^5.1.1",
  "@angular/compiler": "^5.1.1",
  "@angular/core": "^5.1.1",
  "@angular/forms": "^5.1.1",
  "@angular/http": "^5.1.1",
  "@angular/platform-browser": "^5.1.1",
  "@angular/platform-browser-dynamic": "^5.1.1",
  "@angular/router": "^5.1.1",
  "core-js": "^2.5.3",
  "rxjs": "^5.5.5",
  "zone.js": "^0.8.18"
},
  "devDependencies": {
  "@types/jasmine": "^2.8.2",
  "@types/node": "^8.5.1",
  "angular2-template-loader": "^0.6.2",
  "awesome-typescript-loader": "^3.4.1",
  "css-loader": "^0.28.7",
  "extract-text-webpack-plugin": "^3.0.2",
  "file-loader": "^1.1.5",
  "html-webpack-plugin": "^2.30.1",
  "jasmine-core": "^2.8.0",
  "karma": "^1.7.1",
  "karma-chrome-launcher": "^2.2.0",
  "karma-jasmine": "^1.1.1",
  "karma-webpack": "^2.0.7",
  "node-sass": "^4.7.2",
  "raw-loader": "^0.5.1",
  "sass-loader": "^6.0.6",
  "style-loader": "^0.19.0",
  "ts-loader": "^3.2.0",
  "tslint": "^5.8.0",
  "typescript": "^2.6.2",
  "url-loader": "^0.6.2",
  "webpack": "^3.10.0",
  "webpack-dev-server": "^2.9.7"
 }
}

如何解决此错误?

0 个答案:

没有答案