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