gpt4 book ai didi

node.js - Bitbucket 管道运行 npm 失败

转载 作者:IT王子 更新时间:2023-10-29 01:18:07 25 4
gpt4 key购买 nike

我已经为通过 YML 文件运行脚本的 Bitbucket 管道配置了一个 PHP 镜像。我有一个 laravel 存储库,想执行构建命令。

虽然问题是在我的脚本上,当它运行 npm install 时,它失败了。

bash:npm:找不到命令

# This is a sample build configuration for PHP.
# Check our guides at https://confluence.atlassian.com/x/e8YWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: php:7.1.1

pipelines:
default:
- step:
caches:
- composer
script:
- apt-get update && apt-get install -y unzip
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- composer install
- npm install --global gulp-cli
- npm install
- gulp --production

最佳答案

这应该有所帮助。它将安装 Node v8 和 NPM v5。放在npm install --global gulp-cli

之前
script:
- curl -sL https://deb.nodesource.com/setup_8.x | bash -
- apt-get install -y nodejs

关于node.js - Bitbucket 管道运行 npm 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44815086/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com