ncc: Cannot find module `http`

Pretty strange.

2019-02-07T20:11:44.377Z  success Already up-to-date.
2019-02-07T20:11:44.380Z  Done in 0.10s.
2019-02-07T20:11:44.868Z  yarn cache v1.12.3
2019-02-07T20:11:44.905Z  warning package.json: No license field
2019-02-07T20:11:44.923Z  success Cleared cache.
2019-02-07T20:11:44.924Z  Done in 0.06s.
2019-02-07T20:11:56.464Z  { Error: Cannot find module 'http'
                              at s (/var/task/user/index.js:20677:262)
                              at /var/task/user/index.js:20677:419
                              at Object.1.http (/var/task/user/index.js:20677:601)
                              at s (/var/task/user/index.js:20677:368)
                              at /var/task/user/index.js:20677:419
                              at Object.3../_read (/var/task/user/index.js:20677:4298)
                              at s (/var/task/user/index.js:20677:368)
                              at e (/var/task/user/index.js:20677:534)
                              at /var/task/user/index.js:20677:554
                              at module.exports.i (/var/task/user/index.js:20677:61) code: 'MODULE_NOT_FOUND' }
2019-02-07T20:11:56.475Z  Error while initializing entrypoint: { Error: Cannot find module 'http'
                              at s (/var/task/user/index.js:20677:262)
                              at /var/task/user/index.js:20677:419
                              at Object.1.http (/var/task/user/index.js:20677:601)
                              at s (/var/task/user/index.js:20677:368)
                              at /var/task/user/index.js:20677:419
                              at Object.3../_read (/var/task/user/index.js:20677:4298)
                              at s (/var/task/user/index.js:20677:368)
                              at e (/var/task/user/index.js:20677:534)
                              at /var/task/user/index.js:20677:554
                              at module.exports.i (/var/task/user/index.js:20677:61) code: 'MODULE_NOT_FOUND' }
2019-02-07T20:11:56.476Z  REPORT RequestId: 5af847b9-7f68-4260-9279-843409332d98	Duration: 4.25 ms	Billed Duration: 100 ms 	Memory Size: 3008 MB	Max Memory Used: 67 MB	

With now.json

{
  "name": "slack-nda",
  "alias": "slack-nda.now.sh",
  "version": 2,
  "builds": [
    {
      "src": "*.js",
      "use": "@now/node"
    }
  ],
  "env": {
    "SLACK_ACCESS_TOKEN": "@tunnckocorehq-slack-nda-token",
    "SLACK_CLIENT_ID": "@tunnckocorehq-slack-nda-client-id",
    "SLACK_CLIENT_SECRET": "@tunnckocorehq-slack-nda-client-secret"
  }
}

I was using node-fetch, then switched to axios and still fails. Which make sense, since it’s built-in module 😄 But… I can’t understand where this error can come from. Stack traces doesn’t help too?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 3
  • Comments: 16 (6 by maintainers)

Most upvoted comments

Fixed in ncc@0.15.1