2017-07-21 10 views
1

トラブル:VSコードタスク2.0私が使用

  • VSコード1.14.1
  • タスク2.0
  • ノード6.11.1

私の問題は、いくつかのタスクが動作していることで、いくつかはそうではありません。

ここで私のtasks.jsonファイル。

{ 
    "version": "2.0.0", 
    "tasks": [ 
     { // This task work fine. 
      "label": "tsc", 
      "type": "typescript", 
      "tsconfig": "tsconfig.json", 
      "group": { 
       "kind": "build", 
       "isDefault": true 
      } 
     }, 
     { // This task work fine. 
      "taskName": "css", 
      "type": "shell", 
      "command": "./scss.sh", 
      "windows": { 
       "command": "./scss.cmd" 
      }, 
      "presentation": { 
       "reveal": "always", 
       "panel": "new" 
      } 
     },   
     { // This task not work. (See output #1 below) 
      "taskName": "npm-install", 
      "type": "shell", 
      "command": "npm install", 
      "problemMatcher": [], 
      "presentation": { 
       "reveal": "always", 
      } 
     }, 
     { // This task not work. (See output #2 below) 
      "type": "gulp", 
      "task": "clean", 
      "problemMatcher": [] 
     }    
    ] 
} 

出力#1 - 私はタイプシェルの\ NPMとNPMのタスクを実行しようとすると、私は同じ結果を得る: - 私がしようと

> Executing task: npm install < 


Usage: npm <command> 

where <command> is one of: 
    access, adduser, bin, bugs, c, cache, completion, config, 
    ddp, dedupe, deprecate, dist-tag, docs, edit, explore, get, 
    help, help-search, i, init, install, install-test, it, link, 
    list, ln, login, logout, ls, outdated, owner, pack, ping, 
    prefix, prune, publish, rb, rebuild, repo, restart, root, 
    run, run-script, s, se, search, set, shrinkwrap, star, 
    stars, start, stop, t, tag, team, test, tst, un, uninstall, 
    unpublish, unstar, up, update, v, version, view, whoami 

npm <cmd> -h  quick help on <cmd> 
npm -l   display full usage info 
npm help <term> search for help on <term> 
npm help npm  involved overview 

Specify configs in the ini-formatted file: 
    C:\Users\usr\.npmrc 
or on the command line via: npm <command> --key value 
Config info can be viewed via: npm help config 

[email protected] C:\Program Files\nodejs\node_modules\npm 

出力#2をgulpのタスクを実行するにはグローバル(npm install gulp -g)、インストールされているgulpパッケージ(正しい内容のgulpfile.js)):

> Executing task: node_modules\.bin\gulp.cmd clean < 

clean: node_modules.bingulp.cmd: command not found 

私は通常gulp、npm、ノード、cmdなどのツールを使用できますが、VSコードでは正常に動作しますが動作します。この事の

現在のソリューション:

  1. 各もののためのバッチファイルを作成します。
  2. 各バッチファイルのシェルタスクをscss.cmdとして作成
  3. これらのタスクを実行します。

うん、うまくいくが、単純な作業にはあまりにも多くのアクションを実行する必要がある。

この点について何かアドバイスできますか?

答えて

2

私はこの問題の解決策を見つけましたが、問題はデフォルトのターミナルアプリケーションにありました。 のWindows OS Visual Studioのコード使用PowerShellのなどの端末アプリのデフォルトで

は、私の場合、私はのgit - bashのアプリにそれを変更して、この問題を得ました。その後、私はそれをpowershellに戻し、すべてうまく動作します。

なぜgitbashが動作しないのか気にしなかったので、vsコードの設定で追加の設定が必要になる可能性があります。

0

これはVSコードでissueです。コマンドの最後に<が追加されて失敗します。現時点では直接的な修正はないようです。

関連する問題