zeronofreya
V2EX  ›  问与答

vscode NPM 脚本怎样设置?

  •  
  •   zeronofreya · Dec 15, 2021 · 2029 views
    This topic created in 1639 days ago, the information mentioned may be changed or developed.

    目前的报错:

    > Executing task: yarn run dev <
    
    yarn : 无法将“yarn”项识别为 cmdlet 、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
    所在位置 行:1 字符: 1
    + yarn run dev
    + ~~~~
        + CategoryInfo          : ObjectNotFound: (yarn:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException
    
    终端进程“C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command yarn run dev”已终止,退出代码: 1 。
    

    我之前用过 yarn ,目前换到 Pnpm ,yarn 卸载了,但 vscode 还是调用 yarn 运行脚本 配置里也设置

    "npm.packageManager": "pnpm",
    

    但没啥用

    请问怎样做才行?

    2 replies    2021-12-15 20:32:06 +08:00
    pouta
        1
    pouta  
       Dec 15, 2021
    用 cmd 终端试试
    juzisang
        2
    juzisang  
       Dec 15, 2021
    改 package.json > scripts ,换掉 yarn
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5291 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 07:46 · PVG 15:46 · LAX 00:46 · JFK 03:46
    ♥ Do have faith in what you're doing.