【问题标题】:Azure devops pipeline is throwing error installing node jsAzure devops 管道在安装节点 js 时抛出错误
【发布时间】:2021-05-14 06:57:07
【问题描述】:

我正在创建一个 Azure Devops 管道,这是我的管道 -

pool:
  vmImage: ubuntu 16.04

steps:
- task: NodeTool@0  
  inputs:
    versionSpec: ‘14.x’
  displayName: ‘TASK | Install Node.js 14.x ’

但我收到以下错误 -

Starting: ‘TASK | Install Node.js 14.x ’
==============================================================================
Task         : Node.js tool installer
Description  : Finds or downloads and caches the specified version spec of Node.js and adds it to the PATH
Version      : 0.186.0
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/tool/node-js
==============================================================================
Downloading: https://nodejs.org/dist/v0.9.0/node-v0.9.0-linux-x64.tar.gz
Downloading: https://nodejs.org/dist/v0.9.0/win-x64/node.exe
Downloading: https://nodejs.org/dist/v0.9.0/node.exe
Downloading: https://nodejs.org/dist/v0.9.0/node.lib
Caching tool: node 0.9.0 x64

[error]Directory does not exist: /opt/hostedtoolcache/node/0.9.0/x64/bin

Finishing: ‘TASK | Install Node.js 14.x ’

不确定这里出了什么问题。我已经对 versionSpec 进行了相同的测试:12.x、10.x 等,但没有运气

【问题讨论】:

    标签: node.js azure azure-devops yaml azure-pipelines


    【解决方案1】:

    你的字符有误

    请使用这个'

      - task: NodeTool@0  
        inputs:
          versionSpec: '14.x'
        displayName: 'TASK | Install Node.js 14.x '
    

    【讨论】:

    • 我认为这不是问题,因为在我的编辑器中,字符是 ',在复制到 StackOverFlow 时可能放错了位置
    • 好吧,我复制发布了你的代码,我得到了同样的错误。换了个字,现在好了。尝试并自行检查。只需复制粘贴我的代码。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-10-15
    • 2023-01-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-08-31
    • 2018-06-18
    相关资源
    最近更新 更多