[英]Google App Engine - The engine "node" is incompatible with this module
This questions has been asked many times already, and I checked all the answers but none of them helped me.这个问题已经被问过很多次了,我检查了所有的答案,但没有一个对我有帮助。
I'm trying to deploy a NodeJs app to GAE using a app.yml file.我正在尝试使用 app.yml 文件将 NodeJs 应用程序部署到 GAE。 It was working perfectly until my last Github PR on it where I upgraded some nodes modules.
它运行良好,直到我最后一次 Github PR 在它上面我升级了一些节点模块。
Now I'm getting the Error The engine "node" is incompatible with this module. Expected version "16.xx". Got "12.19.0"
现在我收到错误
The engine "node" is incompatible with this module. Expected version "16.xx". Got "12.19.0"
The engine "node" is incompatible with this module. Expected version "16.xx". Got "12.19.0"
The engine "node" is incompatible with this module. Expected version "16.xx". Got "12.19.0"
. The engine "node" is incompatible with this module. Expected version "16.xx". Got "12.19.0"
。
As you can see I'm up to date on my computer.正如你所看到的,我在我的电脑上是最新的。 I also removed and install Node, Npm and Yarn tonight just to be sure.
为了确定,我今晚还删除并安装了 Node、Npm 和 Yarn。
node -v
v16.15.0
npm -v
8.5.5
yarn -v
1.22.18
I tried deploying the app with a specific node version on my packages.json but with or without it's not working.我尝试在我的 packages.json 上部署具有特定节点版本的应用程序,但不管有没有它都不起作用。
"engines": {
"node": "16.x.x"
},
I also tried to remove the cache on GAE using this, without no effect.我还尝试使用此方法删除 GAE 上的缓存,但没有任何效果。
default_expiration: '0d 0h'
On my app.yml I'm using nodejs
en Env: flex
:在我的 app.yml 上,我使用的是
nodejs
en Env: flex
:
runtime: nodejs
env: flex
I can't use node16
as I need env: flex
.我不能使用
node16
因为我需要env: flex
。
Of course I tried to delete the Node_modules and yarn.lock for at least 100 times but still nothing, always the same error.当然,我尝试删除 Node_modules 和 yarn.lock 至少 100 次,但仍然没有,总是同样的错误。
Nothing change on the app.yml file since the last deployment.自上次部署以来,app.yml 文件没有任何变化。 The only thing is that I upgraded some Node Modules.
唯一的事情是我升级了一些节点模块。
On the Yarn side I've tried:在纱线方面,我尝试过:
yarn install --force
yarn install --ignore-engines
yarn cache clean --all
But still not working.但仍然无法正常工作。
Any help will be really grateful.任何帮助将不胜感激。
I had the same issue.我遇到过同样的问题。 The error is because the image used by google is fixed to the version 12.19.0, check here for more info.
该错误是因为 google 使用的图像已修复为 12.19.0 版本,请查看此处了解更多信息。
My workaround was use a custom image:我的解决方法是使用自定义图像:
app.yaml
file the runtime to custom
.app.yaml
文件中的运行时更改为custom
。runtime: custom
env: flex
...
Dockerfile
file with the following content:Dockerfile
文件,内容如下:FROM gcr.io/google_appengine/nodejs
# Current Node LTS version.
RUN /usr/local/bin/install_node '16.16.0'
RUN npm install --unsafe-perm --global yarn
COPY . /app/
RUN yarn install --production || \
((if [ -f yarn-error.log ]; then \
cat yarn-error.log; \
fi) && false)
CMD yarn start
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.