pvdlg / conventional-changelog-metahub

conventional-changelog preset
MIT License
400 stars 41 forks source link

Travis CI - semantic release cannot find module #47

Closed exactlyaron closed 6 years ago

exactlyaron commented 6 years ago

Hi @pvdlg

Firstly I guess I should ask if this package is still up to date and working as far as you know?

It looks ideal in terms of the release types and the formatting and emojis are cool. I've been playing around the commit-analyzer then seen this so it would be quick to test it and then modify as needed rather than building out the standard angular one but I keep getting a module not found error in Travis CI.

I've had a search and found the following issues, here, here and here.

So I've done the things recommended in those issues, stopped caching /.npm, removed cache from within the Travis build UI,

Using install: - travis_retry npm install instead of the normal npm install

But get

[Semantic release]: An error occurred while running semantic-release: { Error: Cannot find module 'conventional-changelog-metahub/release-rules'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15)
    at resolveFileName (/home/travis/.npm/_npx/6676/lib/node_modules/semantic-release/node_modules/import-from/node_modules/resolve-from/index.js:17:39)
    at resolveFrom (/home/travis/.npm/_npx/6676/lib/node_modules/semantic-release/node_modules/import-from/node_modules/resolve-from/index.js:31:9)
    at module.exports (/home/travis/.npm/_npx/6676/lib/node_modules/semantic-release/node_modules/import-from/node_modules/resolve-from/index.js:34:41)
    at module.exports (/home/travis/.npm/_npx/6676/lib/node_modules/semantic-release/node_modules/import-from/index.js:4:49)
    at module.exports (/home/travis/.npm/_npx/6676/lib/node_modules/semantic-release/node_modules/@semantic-release/commit-analyzer/lib/load-release-rules.js:19:57)
    at commitAnalyzer (/home/travis/.npm/_npx/6676/lib/node_modules/semantic-release/node_modules/@semantic-release/commit-analyzer/index.js:24:24)
    at validator (/home/travis/.npm/_npx/6676/lib/node_modules/semantic-release/lib/plugins/normalize.js:43:28)
    at pReduce (/home/travis/.npm/_npx/6676/lib/node_modules/semantic-release/lib/plugins/pipeline.js:36:40)
    at Promise.all.then.value (/home/travis/.npm/_npx/6676/lib/node_modules/semantic-release/node_modules/p-reduce/index.js:16:10)
  code: 'MODULE_NOT_FOUND',
  pluginName: '@semantic-release/commit-analyzer' }
{ Error: Cannot find module 'conventional-changelog-metahub/release-rules'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15)
    at resolveFileName (/home/travis/.npm/_npx/6676/lib/node_modules/semantic-release/node_modules/import-from/node_modules/resolve-from/index.js:17:39)
    at resolveFrom (/home/travis/.npm/_npx/6676/lib/node_modules/semantic-release/node_modules/import-from/node_modules/resolve-from/index.js:31:9)
    at module.exports (/home/travis/.npm/_npx/6676/lib/node_modules/semantic-release/node_modules/import-from/node_modules/resolve-from/index.js:34:41)
    at module.exports (/home/travis/.npm/_npx/6676/lib/node_modules/semantic-release/node_modules/import-from/index.js:4:49)
    at module.exports (/home/travis/.npm/_npx/6676/lib/node_modules/semantic-release/node_modules/@semantic-release/commit-analyzer/lib/load-release-rules.js:19:57)
    at commitAnalyzer (/home/travis/.npm/_npx/6676/lib/node_modules/semantic-release/node_modules/@semantic-release/commit-analyzer/index.js:24:24)
    at validator (/home/travis/.npm/_npx/6676/lib/node_modules/semantic-release/lib/plugins/normalize.js:43:28)
    at pReduce (/home/travis/.npm/_npx/6676/lib/node_modules/semantic-release/lib/plugins/pipeline.js:36:40)
    at Promise.all.then.value (/home/travis/.npm/_npx/6676/lib/node_modules/semantic-release/node_modules/p-reduce/index.js:16:10)
  code: 'MODULE_NOT_FOUND',
  pluginName: '@semantic-release/commit-analyzer' }

It's a private build so can't link to the travis log. But I can send you a copy of the raw if needs be. Semantic-releases shows now errors when loading the plugins etc.

The package.json reelase config is as follows

"release": {
    "analyzeCommits": {
      "preset": "metahub",
      "releaseRules": "conventional-changelog-metahub/release-rules"
    },
    "generateNotes": {
      "preset": "metahub"
    }
  }

Basically the same as how you've done it here

Thanks for any help! 👍

exactlyaron commented 6 years ago

Oh wait I think this is because of the parse-domain package issue. 😕

pvdlg commented 6 years ago

The package should works properly. It seems your problem is related to npm not to this package specifically. It might be caused by the parse-domain but I can't be sure without seeing the rest of the logs.

exactlyaron commented 6 years ago

Hi, ok thanks, here is a log from Travis when it's failed. travis_log.txt You may spot something that I haven't.

pvdlg commented 6 years ago

Is the conventional-changelog-metahub present in your package.json devDependencies?

exactlyaron commented 6 years ago

Yeah it is.

  "devDependencies": {
    "cz-conventional-changelog": "2.1.0",
    "semantic-release": "^15.5.2",
    "conventional-changelog-metahub": "^2.0.2"

I'll run a debug build and check it's actually getting installed.

exactlyaron commented 6 years ago

Yep definitely installed and in node_modules.

exactlyaron commented 6 years ago

Seem to have resolved it by adding skip_cleanup: true to the Travis config.

pvdlg commented 6 years ago

Ok, it can be closed then I guess.