Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have a meteor app that needs to periodically read a file located on the host's file system, outside of the app package. I am using node's fs to accomplish this, and it works fine on my (macOS) development machine.

However, when I run mup deploy to deploy it to my (Ubuntu 14) server, mup returns the following error after starting meteor:

Error: ENOENT: no such file or directory, open '/home/sam/data/all_data.json' at Object.fs.openSync (fs.js:652:18) at Object.fs.readFileSync (fs.js:553:33)

Does anyone know why this might be happening?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
836 views
Welcome To Ask or Share your Answers For Others

1 Answer

you should follow mup documentation closely. Have you seen volumes setup in mup config? Try this to solve your issue.

Reason: mup runs app in docker without any access to host file system unless specified. Volumes setup does this for you with mup deployment.

Below is the part of mup config from http://meteor-up.com/docs.html, Everything Configured, read more to get a better idea.

    name: 'app',
    path: '../app',

    // lets you add docker volumes (optional). Can be used to
    // store files between app deploys and restarts.
    volumes: {
      // passed as '-v /host/path:/container/path' to the docker run command
      '/host/path': '/container/path',
      '/second/host/path': '/second/container/path'
    },

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...