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

Registry error with subdirectory #10

Closed
mattborghi opened this issue Jun 7, 2021 · 1 comment
Closed

Registry error with subdirectory #10

mattborghi opened this issue Jun 7, 2021 · 1 comment

Comments

@mattborghi
Copy link

Hi, I am trying to install my @bit public components on a project that is in a subfolder (frontend/) but I am getting the following error:

npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@mattborghi%2fsciquant.ui.github - Not found
npm ERR! 404 
npm ERR! 404  '@mattborghi/sciquant.ui.github@0.0.2' is not in the npm registry.

I tried moving the .npmrc file into the subfolder but the error persists. The yml file that I used is this one

name: Deploy to Github Pages
on: 
  push:
    branches: 
      - 'main'
jobs:
  Deploy:
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: ./frontend
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          node-version: '14.x'
      - run: npm install
      - run: npm run deploy

I also tried setting this configuration without using the .npmrc file with no luck like this

- uses: actions/setup-node@v2
        with:
          always-auth: true
          node-version: '14.x'
          registry-url: https://node.bit.dev

I get another error in this case

npm WARN audit Audit result from registry missing metadata. This is probably an issue with the registry.
added 2060 packages from 1143 contributors in 49.193s

147 packages are looking for funding
  run `npm fund` for details

npm ERR! Cannot convert undefined or null to object

Does anyone have any idea why this might be happening? Thanks in advance, Matias.

@mattborghi
Copy link
Author

mattborghi commented Jul 13, 2021

For reference, I solved the issue without using the .npmrc file and with the script as follows (check here):

name: Deploy to Github Pages
on: 
  push:
    branches: 
      - 'main'
jobs:
  Deploy:
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: ./frontend
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          always-auth: true
      - name: Install and Build 🔧
        run: |
            npm config set '@mattborghi:registry' https://node.bit.dev
            npm config set @bit:registry https://node.bit.dev
            npm install
      - name: Deploy with gh-pages 🚀 # https://github.com/tschaub/gh-pages/pull/368
        run: | # add the git pull... when merging pull requests
          git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
          git pull origin main
          npm run deploy -- -u "github-actions-bot <support+actions@github.com>"
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

I added these lines for installing bit and my custom components (as shown here)

 npm config set '@mattborghi:registry' https://node.bit.dev
 npm config set @bit:registry https://node.bit.dev

Then I followed some guidelines from the github documentation in order to deploy to github pages using gh-pages.

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

1 participant