npm ci无法在bitbucket管道上工作?

时间:2019-03-06 00:42:11

标签: bitbucket-pipelines npm-ci

我有一个React-native项目,我正在尝试使用bitbucket管道来运行测试并导出到expo。

为此,我尝试遵循this article,但它失败,并显示以下输出:

+ npm ci
npm ERR! path git
npm ERR! code ENOENT
npm ERR! errno ENOENT
npm ERR! syscall spawn git
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t ssh://git@github.com/expo/react-native-maps.git
npm ERR! enoent 
npm ERR! enoent 
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-03-06T00_28_01_570Z-debug.log

问题是,npm ci在我的本地计算机上可以正常工作。

我没主意。有帮助吗?

2 个答案:

答案 0 :(得分:2)

我设法使用“节点”映像而不是“ node:alpine”解决该问题。

也许ssh默认未安装在node:alpine上?

任何进一步的解释将不胜感激:)

答案 1 :(得分:0)

我遇到了类似的错误,唯一的区别是我在import tkinter as tk from tkinter import Tk, Frame, Canvas, BOTH class Draw(Frame): def __init__(self, master): super().__init__(master) self.initUI() def initUI(self): self.pack(fill=BOTH, expand=1) self.canvas = Canvas(self, bg='red') self.canvas.pack(fill=BOTH, expand=1) heightpx = Tk.winfo_screenheight(self) widthpx = Tk.winfo_screenwidth(self) distOrizPx = int(widthpx/4) distVertPx = int(heightpx/4) radiusPx = 50 self.ball01 = self.canvas.create_oval(distOrizPx-radiusPx, distVertPx-radiusPx, distOrizPx+radiusPx, distVertPx+radiusPx, fill="blue", width=1) self.ball02 = self.canvas.create_oval(widthpx-distOrizPx-radiusPx, distVertPx-radiusPx, widthpx-distOrizPx+radiusPx, distVertPx+radiusPx, fill="red", width=0) self.ball03 = self.canvas.create_oval(distOrizPx-radiusPx, heightpx-distVertPx-radiusPx, distOrizPx+radiusPx, heightpx-distVertPx+radiusPx, fill="green", width=0) self.ball04 = self.canvas.create_oval(widthpx-distOrizPx-radiusPx, heightpx-distVertPx-radiusPx, widthpx-distOrizPx+radiusPx, heightpx-distVertPx+radiusPx, fill="yellow", width=0) self.timer(distOrizPx-radiusPx, distVertPx+radiusPx, 17, self.ball01) self.timer(widthpx-distOrizPx-radiusPx, distVertPx+radiusPx, 7, self.ball02) self.timer(distOrizPx-radiusPx, heightpx-distVertPx+radiusPx, 7, self.ball03) self.timer(widthpx-distOrizPx-radiusPx, heightpx-distVertPx+radiusPx, 13, self.ball04) def timer(self, posx, posy, seconds, ball): label = tk.Label(self, text="%i s" % seconds, font="Arial 30") label.place(x=posx, y=posy) label.after(1000, self.refresh_label, label, seconds, ball) def refresh_label(self, label, seconds, ball): seconds -= 1 label.configure(text="%i s" % seconds) if seconds >= 0: label.after(1000, self.refresh_label, label, seconds, ball) elif seconds < 0: label.destroy() self.canvas.delete(ball) class Ball: def __init__(self, master): master.title("Ball") master.geometry("1200x1200") #master.state('zoomed') self.master = master self.draw = Draw(master) if __name__ == "__main__": master = tk.Tk() pyBall = Ball(master) master.mainloop() 图像上使用https URL而不是SSH URL。

为解决此问题,我在运行node:10-alpine之前使用apk add git安装了git。