Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/entity-framework/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio code Can';在vscode任务版本2.0.0中运行npm任务_Visual Studio Code_Vscode Tasks - Fatal编程技术网

Visual studio code Can';在vscode任务版本2.0.0中运行npm任务

Visual studio code Can';在vscode任务版本2.0.0中运行npm任务,visual-studio-code,vscode-tasks,Visual Studio Code,Vscode Tasks,我有package.json和任务: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" }, 我想用build命令在vscode任务中准备整个环境。 我正

我有package.json和任务: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"
},
我想用build命令在vscode任务中准备整个环境。 我正在为vscode尝试新的2.0.0版本的task,但npm task不起作用

"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
但我想用新的。我的配置:

  • vscode 1.15.1
  • 视窗10

这件事已经太晚了,但有一个问题已经解决了。尽管有一条关于修复的评论是“如果我切换回cmd终端,它确实可以工作”,但这已经太晚了,但有一个关于这个的问题已经解决了。尽管有一条关于修复的评论是“如果我切换回终端的cmd,它确实可以工作。”`
"version": "0.1.0",
    "command": "npm",
    "isShellCommand": true,
    "showOutput": "always",
    "suppressTaskName": true,
    "tasks": [
        {
            "taskName": "install",
            "args": [
                "run",
                "task:start"
            ],
            "isBuildCommand": true
        }
    ]