Skip to content

TypeError: "cwd" must be a string on Node 8 #41

@zipang

Description

@zipang

After upgrading to Node 8, we have an error on startup when launching a NodeBB server.
This issue has been documented here : https://community.nodebb.org/topic/10765/error-starting-nodebb-after-upgrade

And here is the full error stack which has its origin in the daemon module used by NodeBB :

TypeError: "cwd" must be a string
    at normalizeSpawnArguments (child_process.js:380:11)
    at Object.exports.spawn (child_process.js:465:38)
    at Function.module.exports.daemon (/www/node-bb/node_modules/daemon/index.js:50:31)
    at module.exports (/www/node-bb/node_modules/daemon/index.js:25:20)
    at /www/node-bb/loader.js:223:21
    at FSReqWrap.oncomplete (fs.js:135:15)

According to the API documentation, process.cwd() is effectively a method : https://nodejs.org/api/process.html#process_process_cwd

The fix is quite trivial and i will provide a Pull Request for it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions