functions-framework-nodejs: nodejs10 runtime doesn't work with .yarnrc yarn-path
I have no idea where I can write bugs for newer nodejs10 runtime
At nodejs8 runtime we used yarn feature yarn-path
in .yarnrc
it allows us to use more modern yarn vs google runtime has. (see https://yarnpkg.com/lang/en/docs/yarnrc/)
But with nodejs10 runtime this feature doesn’t work, on deployment we have error like
Cannot find module '/workspace/bin/yarn-1.13.0/yarn.js'
I created a sample project to reproduce https://github.com/istarkov/nodejs10-runtime-error
if you run there
# uses nodejs8 runtime
yarn deploy:8
project will be deployed, result at https://europe-west1-realadvisor-v1-sites.cloudfunctions.net/test-env will show that used yarn version was 1.13.0
But if you run
# uses nodejs10 runtime
yarn deploy
the result will be
(gcloud.beta.functions.deploy) OperationError: code=3, message=Build failed: {"error": {"canonicalCode": "INVALID_ARGUMENT", "errorMessage": "`npm_install` had stderr output:\ninternal/modules/cjs/loader.js:584\n throw err;\n ^\n\nError: Cannot find module '/workspace/bin/yarn-1.13.0/yarn.js'\n at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)\n at Function.Module._load (internal/modules/cjs/loader.js:508:25)\n at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)\n at startup (internal/bootstrap/node.js:283:19)\n at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)\nnpm ERR! code ELIFECYCLE\nnpm ERR! errno 1\nnpm ERR! test-env@1.0.0 postinstall: `yarn --version > ./version.txt`\nnpm ERR! Exit status 1\nnpm ERR! \nnpm ERR! Failed at the test-env@1.0.0 postinstall script.\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\nnpm WARN Local package.json exists, but node_modules missing, did you mean to install?\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR! /builder/home/.npm/_logs/2019-04-16T17_52_23_870Z-debug.log\nnpm ERR! code ELIFECYCLE\nnpm ERR! errno 1\nnpm ERR! @ preinstall: `npm --prefix functions install`\nnpm ERR! Exit status 1\nnpm ERR! \nnpm ERR! Failed at the @ preinstall script.\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR! /builder/home/.npm/_logs/2019-04-16T17_52_23_911Z-debug.log\n\nerror: `npm_install` returned code: 1", "errorType": "InternalError", "errorId": "8C17AC34"}}
error Command failed with exit code 1.
Please help, at least give me a direction where I can report gcloud issues and bugs, as its not the only issue I know.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 2
- Comments: 15 (10 by maintainers)
Is the ability to use yarn with yarn.lock file in Node 10 engine deployed to Cloud Functions on GCP? Still looks like it is using npm and not yarn when we switch to node 10 (as opposed to node 8).