【问题标题】:Serverless Framework stuck downloading templateServerless Framework 卡住下载模板
【发布时间】:2021-11-28 16:15:16
【问题描述】:

我正在启动一个无服务器项目以在 Windows 上学习它,使用 npm 安装它,在 PowerShell 上运行 serverless,选择 aws-node-express-dynamodb-api 模板,问题是,它永远卡在 Downloading aws-node-express-dynamodb-api template... 中并且永远不会完成它或实际下载任何东西,安装中的唯一错误如下:

msvs_version not set from command line or npm config
gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer
gyp ERR! find VS looking for Visual Studio 2015
gyp ERR! find VS - not found
gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
gyp ERR! find VS
gyp ERR! find VS **************************************************************
gyp ERR! find VS You need to install the latest version of Visual Studio
gyp ERR! find VS including the "Desktop development with C++" workload.
gyp ERR! find VS For more information consult the documentation at:
gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
gyp ERR! find VS **************************************************************

它似乎在尝试配置 Visual Studio,但我不担心,因为我不使用它。

【问题讨论】:

    标签: node.js serverless-framework


    【解决方案1】:

    我的解决方法是卸载 serverless 并使用不同版本的 Node.js 重新安装。安装无服务器时查找 npm 警告。例如,

    $ npm install -g serverless
    npm WARN npm npm does not support Node.js v14.0.0
    ...
    

    以下版本对我有用:节点 v15.0.1。您可以使用Node Version Manager 下载和安装特定版本的 Node。

    $ nvm use 15.0.1
    Now using node v15.0.1 (npm v7.0.3)
    

    或者,尝试不同的安装方法:https://serverless.com/install

    【讨论】:

      猜你喜欢
      • 2020-06-22
      • 2014-11-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-14
      • 2021-02-19
      相关资源
      最近更新 更多