无法在vscode任务版本2.0.0中运行npm任务

时间:2017-08-26 08:31:01

标签: visual-studio-code vscode-tasks

我有我的package.json和任务:启动脚本

"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

这没有任何意义。我的previus配置效果很好......

"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
  • windows 10

0 个答案:

没有答案