renovatebot / config-help

Please use the Discussions feature of https://github.com/renovatebot/renovate instead
https://github.com/renovatebot/renovate/discussions
MIT License
27 stars 16 forks source link

Setting ignore-npmrc-file is not applied #946

Closed leoShabalkin closed 4 years ago

leoShabalkin commented 4 years ago

Which Renovate are you using?

npx renovate new-ui --dry-run true --onboarding false --print-config=true --platform "gitlab" --require-config true --token "${GITLAB_TOKEN}" --endpoint="${GITLAB_URL}/api/v4/" --ignore-npmrc-file true --onboarding-config "{\"baseBranches\":[\"develop\"],\"enabledManagers\":[\"npm\"],\"prFooter\":\"This PR has been generated by renovate\"}" --npmrc="${NPMRC}" --log-level="debug" I also tried to add a parameter --npm-token="${NPM_TOKEN}"

Which platform are you using?

GitLab self-hosted

Have you checked the logs? Don't forget to include them if relevant


        "config": {}
 DEBUG: CLI config
        "config": {
          "repositories": ["new-ui"],
          "dryRun": true,
          "printConfig": true,
          "logLevel": "debug",
          "onboarding": false,
          "onboardingConfig": {
            "baseBranches": ["develop"],
            "enabledManagers": ["npm"],
            "prFooter": "This PR has been generated by renovate"
          },
          "requireConfig": true,
          "platform": "gitlab",
          "endpoint": "https://gitlab-***.ru/api/v4/",
          "token": "***********",
          "npmrc": "***********",
          "npmToken": "***********",
          "ignoreNpmrcFile": true
        }
 DEBUG: Env config
        "config": {"hostRules": []}
 DEBUG: Combined config
        "config": {
          "hostRules": [],
          "repositories": ["new-ui"],
          "dryRun": true,
          "printConfig": true,
          "logLevel": "debug",
          "onboarding": false,
          "onboardingConfig": {
            "baseBranches": ["develop"],
            "enabledManagers": ["npm"],
            "prFooter": "This PR has been generated by renovate"
          },
          "requireConfig": true,
          "platform": "gitlab",
          "endpoint": "https://gitlab-***.ru/api/v4/",
          "token": "***********",
          "npmrc": "***********",
          "npmToken": "***********",
          "ignoreNpmrcFile": true
        }
 DEBUG: Adding trailing slash to endpoint
 DEBUG: Using platform gitAuthor: workflow-automat <workflow-automat@***.ru>
 DEBUG: Using baseDir: /tmp/renovate
 DEBUG: Using cacheDir: /tmp/renovate/cache
 DEBUG: Initializing Renovate internal cache into /tmp/renovate/cache/renovate/renovate-cache-v1
 DEBUG: Commits limit = null
  INFO: Repository started (repository=new-ui)
        "renovateVersion": "23.35.1"
 DEBUG: Using localDir: /tmp/renovate/repos/gitlab/new-ui (repository=new-ui)
 DEBUG: new-ui default branch = feature/DCO-647 (repository=new-ui)
 DEBUG: Enabling Git FS (repository=new-ui)
 DEBUG: new-ui http URL = https://gitlab-***.ru/new-ui.git (repository=new-ui)
 DEBUG: resetMemCache() (repository=new-ui)
 DEBUG: Setting npmrc (repository=new-ui)
 DEBUG: checkOnboarding() (repository=new-ui)
 DEBUG: isOnboarded() (repository=new-ui)
 DEBUG: findFile(renovate.json) (repository=new-ui)
 DEBUG: Initializing git repository into /tmp/renovate/repos/gitlab/new-ui (repository=new-ui)
 DEBUG: git clone completed (repository=new-ui)
        "durationMs": 532
 DEBUG: latest commit (repository=new-ui)
        "latestCommitDate": "2020-10-23T09:43:43+03:00"
 DEBUG: Setting git author name (repository=new-ui)
        "gitAuthorName": "workflow-automat"
 DEBUG: Setting git author email (repository=new-ui)
        "gitAuthorEmail": "workflow-automat"
 DEBUG: findFile(renovate.json5) (repository=new-ui)
 DEBUG: config file exists (repository=new-ui)
 DEBUG: ensureIssueClosing() (repository=new-ui)
 DEBUG: Repo is onboarded (repository=new-ui)
 DEBUG: Found renovate.json5 config file (repository=new-ui)
 DEBUG: Repository config (repository=new-ui)
        "fileName": "renovate.json5",
        "config": {
          "extends": [":rebaseStalePrs"],
          "stabilityDays": 3,
          "commitMessageAction": "Renovate:",
          "lockFileMaintenance": {"enabled": true},
          "baseBranches": ["develop"],
          "ignoreNpmrcFile": true,
          "rangeStrategy": "bump",
          "packageRules": [
            {
              "depTypeList": ["dependencies", "devDependencies"],
              "packagePatterns": ["*"],
              "excludePackagePatterns": [
                "@types/node"
              ],
              "enabled": true
            },
            {
              "packagePatterns": ["@types/node"],
              "assigneesFromCodeOwners": true,
              "major": false,
              "groupName": "Type nodes packages",
              "commitMessageTopic": "dependency {{depName}}"
            }
          ]
        }

****
DEBUG: Processing 36 branches: renovate/date-fns-2.x, renovate/emotion-core-10.x, renovate/eslint-packages, renovate/http-proxy-middleware-1.x, renovate/husky-4.x, renovate/jest-26.x, renovate/lint-staged-packages, renovate/lock-file-maintenance (repository=new-ui)
 DEBUG: Calculated maximum PRs remaining this run (repository=new-ui)
        "prsRemaining": 99
 DEBUG: processBranch with 1 upgrades (repository=new-ui, dependencies=@emotion/core, branch=renovate/emotion-core-10.x)
 DEBUG: Setting current branch to develop (repository=new-ui, branch=renovate/emotion-core-10.x)
 DEBUG: latest commit (repository=new-ui, branch=renovate/emotion-core-10.x)
        "branchName": "develop",
        "latestCommitDate": "2020-10-20T13:37:17+03:00"
 DEBUG: getBranchPr(renovate/emotion-core-10.x) (repository=new-ui, branch=renovate/emotion-core-10.x)
 DEBUG: branchExists=false (repository=new-ui, branch=renovate/emotion-core-10.x)
 DEBUG: Branch has 1 upgrade(s) (repository=new-ui, branch=renovate/emotion-core-10.x)
 DEBUG: recreateClosed is false (repository=new-ui, branch=renovate/emotion-core-10.x)
 DEBUG: findPr(renovate/emotion-core-10.x, chore(deps): renovate: dependency @emotion/core to ^10.0.35, !open) (repository=new-ui, branch=renovate/emotion-core-10.x)
 DEBUG: prAlreadyExisted=false (repository=new-ui, branch=renovate/emotion-core-10.x)
 DEBUG: Checking schedule(at any time, null) (repository=new-ui, branch=renovate/emotion-core-10.x)
 DEBUG: No schedule defined (repository=new-ui, branch=renovate/emotion-core-10.x)
 DEBUG: Branch needs creating (repository=new-ui, branch=renovate/emotion-core-10.x)
 DEBUG: Using reuseExistingBranch: false (repository=new-ui, branch=renovate/emotion-core-10.x)
 DEBUG: manager.getUpdatedPackageFiles() (repository=new-ui, branch=renovate/emotion-core-10.x)
        "reuseExistingBranch": false,
        "branchName": "renovate/emotion-core-10.x"
 DEBUG: npm.updateDependency(): dependencies.@emotion/core = ^10.0.35 (repository=new-ui, branch=renovate/emotion-core-10.x)
 DEBUG: Updating packageFile content (repository=new-ui, packageFile=package.json, branch=renovate/emotion-core-10.x)
        "depName": "@emotion/core"
 DEBUG: Updated 1 package files (repository=new-ui, branch=renovate/emotion-core-10.x)
 DEBUG: Getting updated lock files (repository=new-ui, branch=renovate/emotion-core-10.x)
 DEBUG: lock file dirs (repository=new-ui, branch=renovate/emotion-core-10.x)
        "dirs": {
          "yarnLockDirs": [],
          "npmLockDirs": ["package-lock.json"],
          "pnpmShrinkwrapDirs": [],
          "lernaDirs": []
        }
 DEBUG: Writing repo .npmrc (/tmp/renovate/repos/gitlab/new-ui) (repository=new-ui, branch=renovate/emotion-core-10.x)
 DEBUG: Writing package.json files (repository=new-ui, branch=renovate/emotion-core-10.x)
        "packageFiles": ["package.json"]
 DEBUG: Writing package-lock.json (repository=new-ui, branch=renovate/emotion-core-10.x)
 DEBUG: Writing any updated package files (repository=new-ui, branch=renovate/emotion-core-10.x)
 DEBUG: Writing package.json (repository=new-ui, branch=renovate/emotion-core-10.x)
 DEBUG: npmrc file found in repository (repository=new-ui, branch=renovate/emotion-core-10.x)
 DEBUG: Generating package-lock.json for . (repository=new-ui, branch=renovate/emotion-core-10.x)
 DEBUG: Spawning npm install to create /tmp/renovate/repos/gitlab/new-ui/package-lock.json (repository=new-ui, branch=renovate/emotion-core-10.x)
 DEBUG: Updating lock file only (repository=new-ui, branch=renovate/emotion-core-10.x)
 DEBUG: No node constraint found - using latest (repository=new-ui, branch=renovate/emotion-core-10.x)
 DEBUG: Executing command (repository=new-ui, branch=renovate/emotion-core-10.x)
        "command": "npm install --package-lock-only --ignore-scripts --no-audit"
 DEBUG: lock file error (repository=new-ui, branch=renovate/emotion-core-10.x)
        "err": {
          "killed": false,
          "code": 7,
          "signal": null,
          "cmd": "npm install --package-lock-only --ignore-scripts --no-audit",
          "stdout": "",
          "stderr": "Error: Failed to replace env in config: ${NPM_TOKEN}\n    at /usr/local/lib/node_modules/npm/lib/config/core.js:415:13\n    at String.replace (<anonymous>)\n    at envReplace (/usr/local/lib/node_modules/npm/lib/config/core.js:411:12)\n    at parseField (/usr/local/lib/node_modules/npm/lib/config/core.js:389:7)\n    at /usr/local/lib/node_modules/npm/lib/config/core.js:330:24\n    at Array.forEach (<anonymous>)\n    at Conf.add (/usr/local/lib/node_modules/npm/lib/config/core.js:328:23)\n    at ConfigChain.addString (/usr/local/lib/node_modules/npm/node_modules/config-chain/index.js:244:8)\n    at Conf.<anonymous> (/usr/local/lib/node_modules/npm/lib/config/core.js:316:10)\n    at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:115:16\nTypeError: Cannot read property 'loaded' of undefined\n    at exit (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:97:27)\n    at errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:216:3)\n    at /usr/local/lib/node_modules/npm/bin/npm-cli.js:78:20\n    at cb (/usr/local/lib/node_modules/npm/lib/npm.js:225:22)\n    at /usr/local/lib/node_modules/npm/lib/npm.js:263:24\n    at /usr/local/lib/node_modules/npm/lib/config/core.js:81:7\n    at Array.forEach (<anonymous>)\n    at Conf.<anonymous> (/usr/local/lib/node_modules/npm/lib/config/core.js:80:13)\n    at Conf.f (/usr/local/lib/node_modules/npm/node_modules/once/once.js:25:25)\n    at Object.onceWrapper (events.js:286:20)\n/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:97\n  var doExit = npm.config.loaded ? npm.config.get('_exit') : true\n                          ^\n\nTypeError: Cannot read property 'loaded' of undefined\n    at exit (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:97:27)\n    at process.errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:216:3)\n    at process.emit (events.js:198:13)\n    at process._fatalException (internal/bootstrap/node.js:497:27)\n",
          "message": "Command failed: npm install --package-lock-only --ignore-scripts --no-audit\nError: Failed to replace env in config: ${NPM_TOKEN}\n    at /usr/local/lib/node_modules/npm/lib/config/core.js:415:13\n    at String.replace (<anonymous>)\n    at envReplace (/usr/local/lib/node_modules/npm/lib/config/core.js:411:12)\n    at parseField (/usr/local/lib/node_modules/npm/lib/config/core.js:389:7)\n    at /usr/local/lib/node_modules/npm/lib/config/core.js:330:24\n    at Array.forEach (<anonymous>)\n    at Conf.add (/usr/local/lib/node_modules/npm/lib/config/core.js:328:23)\n    at ConfigChain.addString (/usr/local/lib/node_modules/npm/node_modules/config-chain/index.js:244:8)\n    at Conf.<anonymous> (/usr/local/lib/node_modules/npm/lib/config/core.js:316:10)\n    at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:115:16\nTypeError: Cannot read property 'loaded' of undefined\n    at exit (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:97:27)\n    at errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:216:3)\n    at /usr/local/lib/node_modules/npm/bin/npm-cli.js:78:20\n    at cb (/usr/local/lib/node_modules/npm/lib/npm.js:225:22)\n    at /usr/local/lib/node_modules/npm/lib/npm.js:263:24\n    at /usr/local/lib/node_modules/npm/lib/config/core.js:81:7\n    at Array.forEach (<anonymous>)\n    at Conf.<anonymous> (/usr/local/lib/node_modules/npm/lib/config/core.js:80:13)\n    at Conf.f (/usr/local/lib/node_modules/npm/node_modules/once/once.js:25:25)\n    at Object.onceWrapper (events.js:286:20)\n/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:97\n  var doExit = npm.config.loaded ? npm.config.get('_exit') : true\n                          ^\n\nTypeError: Cannot read property 'loaded' of undefined\n    at exit (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:97:27)\n    at process.errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:216:3)\n    at process.emit (events.js:198:13)\n    at process._fatalException (internal/bootstrap/node.js:497:27)\n",
          "stack": "Error: Command failed: npm install --package-lock-only --ignore-scripts --no-audit\nError: Failed to replace env in config: ${NPM_TOKEN}\n    at /usr/local/lib/node_modules/npm/lib/config/core.js:415:13\n    at String.replace (<anonymous>)\n    at envReplace (/usr/local/lib/node_modules/npm/lib/config/core.js:411:12)\n    at parseField (/usr/local/lib/node_modules/npm/lib/config/core.js:389:7)\n    at /usr/local/lib/node_modules/npm/lib/config/core.js:330:24\n    at Array.forEach (<anonymous>)\n    at Conf.add (/usr/local/lib/node_modules/npm/lib/config/core.js:328:23)\n    at ConfigChain.addString (/usr/local/lib/node_modules/npm/node_modules/config-chain/index.js:244:8)\n    at Conf.<anonymous> (/usr/local/lib/node_modules/npm/lib/config/core.js:316:10)\n    at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:115:16\nTypeError: Cannot read property 'loaded' of undefined\n    at exit (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:97:27)\n    at errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:216:3)\n    at /usr/local/lib/node_modules/npm/bin/npm-cli.js:78:20\n    at cb (/usr/local/lib/node_modules/npm/lib/npm.js:225:22)\n    at /usr/local/lib/node_modules/npm/lib/npm.js:263:24\n    at /usr/local/lib/node_modules/npm/lib/config/core.js:81:7\n    at Array.forEach (<anonymous>)\n    at Conf.<anonymous> (/usr/local/lib/node_modules/npm/lib/config/core.js:80:13)\n    at Conf.f (/usr/local/lib/node_modules/npm/node_modules/once/once.js:25:25)\n    at Object.onceWrapper (events.js:286:20)\n/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:97\n  var doExit = npm.config.loaded ? npm.config.get('_exit') : true\n                          ^\n\nTypeError: Cannot read property 'loaded' of undefined\n    at exit (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:97:27)\n    at process.errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:216:3)\n    at process.emit (events.js:198:13)\n    at process._fatalException (internal/bootstrap/node.js:497:27)\n\n    at ChildProcess.exithandler (child_process.js:294:12)\n    at ChildProcess.emit (events.js:198:13)\n    at ChildProcess.EventEmitter.emit (domain.js:448:20)\n    at maybeClose (internal/child_process.js:982:16)\n    at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)"
        },
        "type": "npm"
 DEBUG: No updated lock files in branch (repository=new-ui, branch=renovate/emotion-core-10.x)
 DEBUG: Branch timestamp: 2020-08-18T12:32:47.694Z (repository=new-ui, branch=renovate/emotion-core-10.x)
 DEBUG: PR is older than a day, raise PR with lock file errors (repository=new-ui, branch=renovate/emotion-core-10.x)
 DEBUG: 1 file(s) to commit (repository=new-ui, branch=renovate/emotion-core-10.x)```

### What would you like to do?
When launching the renovate via the npx with the flag npmrc and ignore-npmrc-file equal true, other npmrc files should be ignored
rarkins commented 4 years ago

It's pretty impossible to know what's going on based on this. ignoreNpmrcFile is irrelevant anyway if you have defined an .npmrc file so the premise of this issue is wrong to begin with. You can see the log DEBUG: Writing repo .npmrc which should be whatever you configured in your $NPMRC you passed.

leoShabalkin commented 4 years ago

Yes, I pull the renovate repository and started running debug with my custom parameters, and everything went well. But, if I run from gitlab ci, I get error. I have tried running with the parameter --npmrc=//my-url, the error is not changed.

rarkins commented 4 years ago

Don't use NPM_TOKEN in your --npmrc param - put the token in there and remove --npm-token and --ignore-npmrc-file.

leoShabalkin commented 4 years ago

I don't use NPM_TOKEN in the --npmrc. In my ci has npmrc initialization with NPM_TOKEN. I just want him to ignore it and form npmrc it from the parameter --npmrc

rarkins commented 4 years ago

Please remove --npm-token and --ignore-npmrc-file and get a fresh log from another npm install attempt.

leoShabalkin commented 4 years ago

Fresh log

npx renovate new-ui --dry-run true --onboarding false --print-config=true --platform "gitlab" --require-config true --token "${GITLAB_TOKEN}" --endpoint="${GITLAB_URL}/api/v4/" --onboarding-config "{\"baseBranches\":[\"develop\"],\"enabledManagers\":[\"npm\"],\"prFooter\":\"This PR has been generated by renovate\"}" --npmrc="${RENOVATE_NPMRC}" --log-level="debug"
DEBUG: File config
        "config": {}
 DEBUG: CLI config
        "config": {
          "repositories": ["new-ui"],
          "dryRun": true,
          "printConfig": true,
          "logLevel": "debug",
          "onboarding": false,
          "onboardingConfig": {
            "baseBranches": ["develop"],
            "enabledManagers": ["npm"],
            "prFooter": "This PR has been generated by renovate"
          },
          "requireConfig": true,
          "platform": "gitlab",
          "endpoint": "https://gitlab-***.ru/api/v4/",
          "token": "***********",
          "npmrc": "***********"
        }
 DEBUG: Env config
        "config": {"hostRules": [], "npmrc": "***********"}
 DEBUG: Combined config
        "config": {
          "hostRules": [],
          "npmrc": "***********",
          "repositories": ["new-ui"],
          "dryRun": true,
          "printConfig": true,
          "logLevel": "debug",
          "onboarding": false,
          "onboardingConfig": {
            "baseBranches": ["develop"],
            "enabledManagers": ["npm"],
            "prFooter": "This PR has been generated by renovate"
          },
          "requireConfig": true,
          "platform": "gitlab",
          "endpoint": "https://gitlab-***.ru/api/v4/",
          "token": "***********"
        }
 DEBUG: Adding trailing slash to endpoint
 DEBUG: Using platform gitAuthor: pfa-workflow-automat <pfa-workflow-automat>
 DEBUG: Using baseDir: /tmp/renovate
 DEBUG: Using cacheDir: /tmp/renovate/cache
 DEBUG: Initializing Renovate internal cache into /tmp/renovate/cache/renovate/renovate-cache-v1
 DEBUG: Commits limit = null
  INFO: Repository started (repository=new-ui)
        "renovateVersion": "23.35.1"
 DEBUG: Using localDir: /tmp/renovate/repos/gitlab/new-ui (repository=new-ui)
 DEBUG: new-ui default branch = feature/DCO-647 (repository=new-ui)
 DEBUG: Enabling Git FS (repository=new-ui)
 DEBUG: new-ui http URL = https://gitlab-rnd.tcsbank.ru/new-ui.git (repository=new-ui)
 DEBUG: resetMemCache() (repository=new-ui)
 DEBUG: Setting npmrc (repository=new-ui)
 DEBUG: checkOnboarding() (repository=new-ui)
 DEBUG: isOnboarded() (repository=new-ui)
 DEBUG: findFile(renovate.json) (repository=new-ui)
 DEBUG: Initializing git repository into /tmp/renovate/repos/gitlab/new-ui (repository=new-ui)
 DEBUG: git clone completed (repository=new-ui)
        "durationMs": 497
 DEBUG: latest commit (repository=new-ui)
        "latestCommitDate": "2020-10-23T09:43:43+03:00"
 DEBUG: Setting git author name (repository=new-ui)
        "gitAuthorName": "pfa-workflow-automat"
 DEBUG: Setting git author email (repository=new-ui)
        "gitAuthorEmail": "pfa-workflow-automat"
 DEBUG: findFile(renovate.json5) (repository=new-ui)
 DEBUG: config file exists (repository=new-ui)
 DEBUG: ensureIssueClosing() (repository=new-ui)
 DEBUG: Repo is onboarded (repository=new-ui)
 DEBUG: Found renovate.json5 config file (repository=new-ui)
 DEBUG: Repository config (repository=new-ui)
        "fileName": "renovate.json5",
        "config": {
          "extends": [":rebaseStalePrs"],
          "stabilityDays": 3,
          "commitMessageAction": "Renovate:",
          "lockFileMaintenance": {"enabled": true},
          "baseBranches": ["develop"],
          "rangeStrategy": "bump",
          "packageRules": [
            {
              "depTypeList": ["dependencies", "devDependencies"],
              "packagePatterns": ["*"],
              "excludePackagePatterns": [
                "@types/node"
              ],
              "enabled": true
            },
            {
              "packagePatterns": ["@types/node"],
              "assigneesFromCodeOwners": true,
              "major": false,
              "groupName": "Type nodes packages",
              "commitMessageTopic": "dependency {{depName}}"
            }
          ]
        }
 DEBUG: migrateAndValidate() (repository=new-ui)
 DEBUG: Config migration necessary (repository=new-ui)
        "oldConfig": {
          "extends": [":rebaseStalePrs"],
          "stabilityDays": 3,
          "commitMessageAction": "Renovate:",
          "lockFileMaintenance": {"enabled": true},
          "baseBranches": ["develop"],
          "rangeStrategy": "bump",
          "packageRules": [
            {
              "depTypeList": ["dependencies", "devDependencies"],
              "packagePatterns": ["*"],
              "excludePackagePatterns": [
                "@types/node"
              ],
              "enabled": true
            },
            {
              "packagePatterns": ["@types/node"],
              "assigneesFromCodeOwners": true,
              "major": false,
              "groupName": "Type nodes packages",
              "commitMessageTopic": "dependency {{depName}}"
            }
          ]
        },
        "newConfig": {
          "extends": [":rebaseStalePrs"],
          "stabilityDays": 3,
          "commitMessageAction": "Renovate:",
          "lockFileMaintenance": {"enabled": true},
          "baseBranches": ["develop"],
          "rangeStrategy": "bump",
          "packageRules": [
            {
              "depTypeList": ["dependencies", "devDependencies"],
              "packagePatterns": ["*"],
              "excludePackagePatterns": [
                "@types/node"
              ],
              "enabled": true
            },
            {
              "packagePatterns": ["@types/node"],
              "assigneesFromCodeOwners": true,
              "major": {"enabled": false},
              "groupName": "Type nodes packages",
              "commitMessageTopic": "dependency {{depName}}"
            }
          ]
        }
 DEBUG: massaged config (repository=new-ui)
        "config": {
          "extends": [":rebaseStalePrs"],
          "stabilityDays": 3,
          "commitMessageAction": "Renovate:",
          "lockFileMaintenance": {"enabled": true},
          "baseBranches": ["develop"],
          "rangeStrategy": "bump",
          "packageRules": [
            {
              "depTypeList": ["dependencies", "devDependencies"],
              "packagePatterns": ["*"],
              "excludePackagePatterns": [
                "@types/node"
              ],
              "enabled": true
            },
            {
              "packagePatterns": ["@types/node"],
              "assigneesFromCodeOwners": true,
              "groupName": "Type nodes packages",
              "commitMessageTopic": "dependency {{depName}}"
            },
            {
              "packagePatterns": ["@types/node"],
              "assigneesFromCodeOwners": true,
              "groupName": "Type nodes packages",
              "commitMessageTopic": "dependency {{depName}}",
              "updateTypes": ["major"],
              "enabled": false
            }
          ]
        }

        *****

        DEBUG: Calculated maximum PRs remaining this run (repository=new-ui)
                "prsRemaining": 99
         DEBUG: processBranch with 1 upgrades (repository=new-ui, dependencies=@emotion/core, branch=renovate/emotion-core-10.x)
         DEBUG: Setting current branch to develop (repository=new-ui, branch=renovate/emotion-core-10.x)
         DEBUG: latest commit (repository=new-ui, branch=renovate/emotion-core-10.x)
                "branchName": "develop",
                "latestCommitDate": "2020-10-20T13:37:17+03:00"
         DEBUG: getBranchPr(renovate/emotion-core-10.x) (repository=new-ui, branch=renovate/emotion-core-10.x)
         DEBUG: branchExists=false (repository=new-ui, branch=renovate/emotion-core-10.x)
         DEBUG: Branch has 1 upgrade(s) (repository=new-ui, branch=renovate/emotion-core-10.x)
         DEBUG: recreateClosed is false (repository=new-ui, branch=renovate/emotion-core-10.x)
         DEBUG: findPr(renovate/emotion-core-10.x, chore(deps): renovate: dependency @emotion/core to ^10.0.35, !open) (repository=new-ui, branch=renovate/emotion-core-10.x)
         DEBUG: prAlreadyExisted=false (repository=new-ui, branch=renovate/emotion-core-10.x)
         DEBUG: Checking schedule(at any time, null) (repository=new-ui, branch=renovate/emotion-core-10.x)
         DEBUG: No schedule defined (repository=new-ui, branch=renovate/emotion-core-10.x)
         DEBUG: Branch needs creating (repository=new-ui, branch=renovate/emotion-core-10.x)
         DEBUG: Using reuseExistingBranch: false (repository=new-ui, branch=renovate/emotion-core-10.x)
         DEBUG: manager.getUpdatedPackageFiles() (repository=new-ui, branch=renovate/emotion-core-10.x)
                "reuseExistingBranch": false,
                "branchName": "renovate/emotion-core-10.x"
         DEBUG: npm.updateDependency(): dependencies.@emotion/core = ^10.0.35 (repository=new-ui, branch=renovate/emotion-core-10.x)
         DEBUG: Updating packageFile content (repository=new-ui, packageFile=package.json, branch=renovate/emotion-core-10.x)
                "depName": "@emotion/core"
         DEBUG: Updated 1 package files (repository=new-ui, branch=renovate/emotion-core-10.x)
         DEBUG: Getting updated lock files (repository=new-ui, branch=renovate/emotion-core-10.x)
         DEBUG: lock file dirs (repository=new-ui, branch=renovate/emotion-core-10.x)
                "dirs": {
                  "yarnLockDirs": [],
                  "npmLockDirs": ["package-lock.json"],
                  "pnpmShrinkwrapDirs": [],
                  "lernaDirs": []
                }
         DEBUG: Writing repo .npmrc (/tmp/renovate/repos/gitlab/new-ui) (repository=new-ui, branch=renovate/emotion-core-10.x)
         DEBUG: Writing package.json files (repository=new-ui, branch=renovate/emotion-core-10.x)
                "packageFiles": ["package.json"]
         DEBUG: Writing package-lock.json (repository=new-ui, branch=renovate/emotion-core-10.x)
         DEBUG: Writing any updated package files (repository=new-ui, branch=renovate/emotion-core-10.x)
         DEBUG: Writing package.json (repository=new-ui, branch=renovate/emotion-core-10.x)
         DEBUG: npmrc file found in repository (repository=new-ui, branch=renovate/emotion-core-10.x)
         DEBUG: Generating package-lock.json for . (repository=new-ui, branch=renovate/emotion-core-10.x)
         DEBUG: Spawning npm install to create /tmp/renovate/repos/gitlab/new-ui/package-lock.json (repository=new-ui, branch=renovate/emotion-core-10.x)
         DEBUG: Updating lock file only (repository=new-ui, branch=renovate/emotion-core-10.x)
         DEBUG: No node constraint found - using latest (repository=new-ui, branch=renovate/emotion-core-10.x)
         DEBUG: Executing command (repository=new-ui, branch=renovate/emotion-core-10.x)
                "command": "npm install --package-lock-only --ignore-scripts --no-audit"
         DEBUG: lock file error (repository=new-ui, branch=renovate/emotion-core-10.x)
                "err": {
                  "killed": false,
                  "code": 7,
                  "signal": null,
                  "cmd": "npm install --package-lock-only --ignore-scripts --no-audit",
                  "stdout": "",
                  "stderr": "Error: Failed to replace env in config: ${NPM_TOKEN}\n 
rarkins commented 4 years ago

Where is the ${NPM_TOKEN} coming from? Is that an .npmrc file you have committed to the repo?

leoShabalkin commented 4 years ago

Yes, I have the next step in my CI

nightly-build:
  stage: pre-build
  before_script:
    - *npm_login
  script:
    - .gitlab/steps/nightly-build.sh
  dependencies: []
.npm_login: &npm_login |
  #!/bin/sh
  echo '//npm.***.io/:_authToken=${NPM_TOKEN}'>~/.npmrc
  echo '//npm.gke.***.ru/:_authToken=${NPM_TOKEN}'>~/.npmrc
  echo 'unsafe-perm = true'>>~/.npmrc

nightly-build.sh

#!/bin/bash

[[ "$TRACE" ]] && set -o xtrace
set -o pipefail
set -o errexit
NODE_ENV=development npm install --unsafe-perm
npm run --if-present nightly

npx renovate new-ui --dry-run true --onboarding false --print-config=true --platform "gitlab" --require-config true --token "${GITLAB_TOKEN}" --endpoint="${GITLAB_URL}/api/v4/" --onboarding-config "{\"baseBranches\":[\"develop\"],\"enabledManagers\":[\"npm\"],\"prFooter\":\"This PR has been generated by renovate\"}" --npmrc="${RENOVATE_NPMRC}" --log-level="debug"
rarkins commented 4 years ago

If you must add that .npmrc file then you could try setting --trust-level=high so that all env is passed from Renovate to child processes.

viceice commented 4 years ago

@leoShabalkin if you use gitlab runner for renovate, you shoud use --endpoint="${CI_API_V4_URL}" instead of --endpoint="${GITLAB_URL}/api/v4/"

viceice commented 4 years ago

also here are good samples how to use renovate with gitlab

leoShabalkin commented 4 years ago

Thanks, with the parameter trust-level everything worked as I planned.