相关疑难解决方法(0)

"npm config set registry https://registry.npmjs.org/"在Windows bat文件中不起作用

我在Windows 7上创建a.bat,a.bat的内容是:

@echo off
npm config set registry https://registry.npmjs.org/
Run Code Online (Sandbox Code Playgroud)

然后运行a.bat,但不工作,我发现单词"set"是npm和bat的特殊关键字,有什么方法可以解决这个问题吗?

batch-file node.js npm

162
推荐指数
7
解决办法
30万
查看次数

在 Github Action 中如何引用私有包进行测试?

我已经为 Github Action 编写了一个测试文件:

测试.yml

name: Test
on:
  push:
    branches: [main]
  pull_request:
    branches: [main]
jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [14.x, 16.x]
    steps:
      - uses: actions/checkout@v2
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v2
        with:
          node-version: ${{ matrix.node-version }}
      - run: npm ci
      - run: npm run build --if-present
      - run: npm test
Run Code Online (Sandbox Code Playgroud)

但我的package.json使用组织私有存储库。当 Github Action 运行时,它失败并出现错误:

npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@org/repo/
npm ERR! 404 
npm ERR! 404  '@org/repo@1.2.3' …
Run Code Online (Sandbox Code Playgroud)

testing yaml unit-testing node.js github-actions

5
推荐指数
1
解决办法
2703
查看次数

标签 统计

node.js ×2

batch-file ×1

github-actions ×1

npm ×1

testing ×1

unit-testing ×1

yaml ×1