我在Firebae云功能项目中使用github repo标记作为npm模块,它在本地环境中运行良好。
//package.json
"@instantish/martian": "github:Rakmo33/martian#v2.3.0",
然而,当我部署到Firebase云功能时,它会抛出以下错误:
"Build failed: npm ERR! Error while executing:nnpm ERR! /usr/bin/git ls-remote -h -t ssh://git@github.com/Rakmo33/martian.gitnnpm ERR! nnpm ERR!
Host key verification failed.nnpm ERR! fatal: Could not read from remote repository.nnpm ERR! nnpm ERR!
Please make sure you have the correct access rightsnnpm ERR! and the repository exists.nnpm ERR! nnpm ERR! exited with error code: 128nnnpm ERR!
A complete log of this run can be found in:nnpm ERR! /www-data-home/.npm/_logs/2021-11-25T10_28_13_554Z-debug.log; Error ID: beaf8772"
不知道项目的细节,但事实是,如果您执行了:
npm install git+https://git@github.com/Rakmo33/martian.git#v2.3.0
你的package.json
:中会有这样的东西
"dependencies": {
"@rakmo33/martian_fork": "git+https://git@github.com/Rakmo33/martian.git#v2.3.0"
}
并且您可以避免使用任何受密码保护的SSH密钥。