1

package.json とtask:startスクリプトがあります

"scripts": {
    "task:start": "rm -rf bin && npm run prepare_env && npm run build",
    "prepare_env": "bash ../scripts/prepare-node-modules.sh",
    "build": "tsc --watch"
},

vscode タスクで環境全体を準備するビルド コマンドが必要です。vscode のタスクの新しい 2.0.0 バージョンを試していますが、npm タスクが機能しません。

"version": "2.0.0",
    "tasks": [
        {
            "type": "npm",
            "script": "task:start",
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]

出力は次のとおりです。

> Executing task: npm run task:start <


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\Dariusz\.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config

npm@3.10.10 C:\Program Files\nodejs\node_modules\npm

これは意味がありません。私の以前の構成はうまく機能します...

"version": "0.1.0",
    "command": "npm",
    "isShellCommand": true,
    "showOutput": "always",
    "suppressTaskName": true,
    "tasks": [
        {
            "taskName": "install",
            "args": [
                "run",
                "task:start"
            ],
            "isBuildCommand": true
        }
    ]

でも新しいのを使いたい。私の構成:

  • vscode 1.15.1
  • ウィンドウズ10
4

0 に答える 0