default.cow not found when running now/node tutorial
See original GitHub issueGoing through the set up steps here: https://zeit.co/docs/v2/deployments/official-builders/node-js-now-node#when-to-use-it
But getting the following from my now deployment logs and a 502 from the running instance: https://temp-imxkpb08t.now.sh/api/cowsay/?text=aoeu
Error: ENOENT: no such file or directory, open '/var/task/user/api/cows/default.cow'
at Object.fs.openSync (fs.js:646:18)
at Object.fs.readFileSync (fs.js:551:33)
at Object.get (/var/task/user/api/cowsay/index.js:1:3111)
at doIt (/var/task/user/api/cowsay/index.js:1:3949)
at say$1 (/var/task/user/api/cowsay/index.js:1:3753)
at Server.cowsay_1 (/var/task/user/api/cowsay/index.js:1:4247)
at emitTwo (events.js:126:13)
at Server.emit (events.js:214:7)
at parserOnIncoming (_http_server.js:619:12)
at HTTPParser.parserOnHeadersComplete (_http_common.js:115:23)
Expected to see the cow output.

Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
default.cow not found when running now/node tutorial #1645
Error: ENOENT: no such file or directory, open '/var/task/user/api/cows/default.cow' at Object.fs.openSync (fs.js:646:18) at Object.fs.
Read more >NOWNodes: Blockchain Developer API | Nodes & Explorers API
Get access and build your Web3 projects on blockchain networks like Bitcoin, Binance Smart Chain, Ethereum, Monero, Bitcoin SV and others easily with ......
Read more >RAM high load on node with no VM running - Proxmox forums
I am doing some performance checks in a dedicated server with latest proxmox 4.1 (including the today kernel enterprise repo update).
Read more >INTERFACE TEAM PUBLIC REPORT VOLUME 5(U) NAVAL ...
This report is the fifth in a series that is being published by the. KAPSE Interface Team (KIT). The first was published as...
Read more >Untitled
Unique tax reference application, Asus 453ma review, Pobjednik dore 2012, ... Explode gib mir 10, Ups not available to sign, Vogoban, Royal pharm...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @codeallthethingz and @liudonghua123! Would mind trying the most update to this example? It should have fixed this issue! https://zeit.co/docs/v2/deployments/official-builders/node-js-now-node 🙏
@liudonghua123 I’ve looked at the cowsay source and it seems like that it uses a bunch of text files that will be read at runtime.
Since the node builder only creates sort of a single executable with all the required .js files, it won’t include those text files in the final output. And that’s why it won’t find those files. However, cowsay has a build folder in which it offers a js file that includes the contents of the textfiles as strings, so no system read calls.
I didn’t find anything about that in the cowsay readme though. Maybe a short info about that in the example would make things more clear? @timothyis