Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gitlab CI error "Cannot find module '@semantic-release/changelog'" #1673

Closed
shockhs opened this issue Oct 30, 2020 · 1 comment
Closed

Gitlab CI error "Cannot find module '@semantic-release/changelog'" #1673

shockhs opened this issue Oct 30, 2020 · 1 comment

Comments

@shockhs
Copy link

shockhs commented Oct 30, 2020

My gitlab ci config for release job looks like

release:
  tags:
    - powershell
  stage: release
  variables:
      GITLAB_TOKEN: $ACCESS_TOKEN
  before_script:
    - npm install -g semantic-release @semantic-release/changelog @semantic-release/commit-analyzer @semantic-release/gitlab @semantic-release/git @semantic-release/npm @semantic-release/release-notes-generator
  script:
      - npx semantic-release
  only:
      - master
  except:
    refs:
      - tags
    variables:
      - $CI_COMMIT_TITLE =~ /^RELEASE:.+$/
branches: ['master']
ci: true
debug: true
dryRun: false
tagFormat: '${version}'

preset: 'conventionalcommits'
gitlabUrl: 'https://url/' # your gitlab url

verifyConditions:
  - '@semantic-release/changelog'
  - '@semantic-release/git'
  - '@semantic-release/gitlab'

analyzeCommits:
  - path: '@semantic-release/commit-analyzer'

generateNotes:
  - path: '@semantic-release/release-notes-generator'
    writerOpts:
      groupBy: 'type'
      commitGroupsSort: 'title'
      commitsSort: 'header'
    linkCompare: true
    linkReferences: true

prepare:
  - path: '@semantic-release/changelog'
  - path: '@semantic-release/git'
    message: 'RELEASE: ${nextRelease.version}'
    assets: ['CHANGELOG.md']

publish:
  - path: '@semantic-release/gitlab'

success: false

fail: false

Everytime in release job I have an error, but I have installed modules in before_script. What could be wrong?

Cannot find module '@semantic-release/changelog'
@shockhs shockhs changed the title Gitlab CI errro "Cannot find module '@semantic-release/changelog'" Gitlab CI error "Cannot find module '@semantic-release/changelog'" Oct 30, 2020
@shockhs shockhs closed this as completed Oct 30, 2020
@travi
Copy link
Member

travi commented Oct 30, 2020

do you happen to have semantic-release installed as a local dependency? i see that you are installing your plugins as global dependencies. npx will prefer a local dependency over a global one, if it exists, and the plugins need to be installed in the same location as semantic-release for them to be found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants