1

I'm new in Google Cloud Resources.

I'm deploying a Nodejs(with Markojs) application at google cloud's app engine and I'm getting the error "EROFS: read-only file system, open '/srv/src/app/converter/form/.7.1565968890124.converter.marko.js'"

At Google documentaion is said "Filesystem The runtime includes a full filesystem. The filesystem is read-only except for the location /tmp, which is a virtual disk storing data in your App Engine instance's RAM."

Link: https://cloud.google.com/appengine/docs/standard/nodejs/runtime#filesystem

I ran "echo $PATH" from "Production environment" and I got "/srv/node_modules/.bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

I'm trying set up the environment variable "PATH" in order to fix the path "/srv/.node_modules to /tmp/.node_modules". I don't know whether it'll fix the problem.

On app.yaml file I wrote,

#   Copyright 2018, Google LLC.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# [START runtime]
runtime: nodejs10

env_variables:
  ## Put production environment variables here.
  ## PATH: /tmp/node_modules/.bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
  PATH: /tmp/node_modules/.bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
  _: /tmp
  HOME: /tmp

The full error is:

Error: EROFS: read-only file system, open '/srv/src/app/converter/form/.7.1565968890124.converter.marko.js' at Object.openSync (fs.js:443:3) at Object.writeFileSync (fs.js:1194:35) at compile (/srv/node_modules/marko/dist/node-require/index.js:61:16) at Object.markoRequireExtension [as .marko] (/srv/node_modules/marko/dist/node-require/index.js:115:27) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Module.require (internal/modules/cjs/loader.js:690:17) at require (internal/modules/cjs/helpers.js:25:18)
at Bin2DecView.get template [as template] (/srv/src/app/converter/Bin2DecView.js:9:16)

Thank you very much in advance!

1 Answers1

2

The marko/node-require hook writes to the filesystem by default, but you can configure this:

require("marko/node-require").install({
  writeToDisk: false
});

src/compiler/config.js#L32-L37

mlrawlings
  • 711
  • 4
  • 9
  • Thank you so much! In a first moment I did this configuration and at first didn't work. So I had to remove folder node_module and "npm install" again and then worked! – Bruno Moura Aug 17 '19 at 08:54