我正在尝试在 Google Cloud 的 App Engine 中部署 node.js 程序,但出现以下错误:
Step #1: npm ERR! Error while executing:
Step #1: npm ERR! /usr/bin/git ls-remote -h -t https://source.developers.google.com/p/(project)/r/(repository)
Step #1: npm ERR!
Step #1: npm ERR! fatal: remote error:
Step #1: npm ERR!
Step #1: npm ERR!
Step #1: npm ERR! Invalid authentication credentials.
Step #1: npm ERR!
Step #1: npm ERR! Please generate a new identifier:
Step #1: npm ERR! https://source.developers.google.com/auth/start?scopes=https://www.googleapis.com/auth/cloud-platform
Step #1: npm ERR!
Step #1: npm ERR!
Step #1: npm ERR!
Step #1: npm ERR! exited with error code: 128
这是因为我的项目中的依赖项位于https://source.developers.google.com/p/(project)/r/(repository)
. 如错误消息中给出的页面所述,我可以在我的本地计算机和云 shell 中借助 .netrc 文件安装此依赖项而不会出现错误,但似乎我无法复制此文件在我的部署中。
有没有办法指定应该使用哪些凭据?请注意,我无法使用npm 文档user:pass@host
中解释的格式,因为 Google 给我的用户名和密码包含 @s 和 \s。