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

lerna this[method] is not a function #2225

Closed
upcwangying opened this issue Aug 13, 2019 · 2 comments

Comments

@upcwangying
Copy link

commented Aug 13, 2019

Expected Behavior

Current Behavior

Execute the lerna publish command to report an error. The Github repo tag has been created successfully, and the npm package failed to be published.

lerna.json

{
  "changelog": {
    "labels": {
      "pr(enhancement)": ":rocket: Enhancement",
      "pr(bug)": ":bug: Bug Fix",
      "pr(documentation)": ":book: Documentation",
      "pr(dependency)": ":deciduous_tree: Dependency",
      "pr(chore)": ":turtle: Chore"
    },
    "repo": "upcwangying/githubjs",
    "cacheDir": ".changelog"
  },
  "packages": [
    "packages/*"
  ],
  "version": "independent"
}

lerna-debug.log

0 silly argv { _: [ 'publish' ],
0 silly argv   'conventional-commits': true,
0 silly argv   conventionalCommits: true,
0 silly argv   composed: 'publish',
0 silly argv   lernaVersion: '3.16.4',
0 silly argv   '$0':
0 silly argv    '/Users/ying/workspace/FEProjects/githubjs/node_modules/.bin/lerna' }
1 notice cli v3.16.4
2 verbose rootPath /Users/ying/workspace/FEProjects/githubjs
3 info versioning independent
4 verbose session 30fef62bf365cab9
5 verbose user-agent lerna/3.16.4/node@v10.16.0+x64 (darwin)
6 silly argv { _: [ 'publish' ],
6 silly argv   'conventional-commits': true,
6 silly argv   conventionalCommits: true,
6 silly argv   composed: 'publish',
6 silly argv   lernaVersion: '3.16.4' }
7 verbose rootPath /Users/ying/workspace/FEProjects/githubjs
8 silly isAnythingCommitted
9 verbose isAnythingCommitted 1
10 silly currentBranch
11 verbose currentBranch master
12 silly remoteBranchExists
13 silly isBehindUpstream
14 silly isBehindUpstream master is behind origin/master by 0 commit(s) and ahead by 0
15 silly hasTags
16 verbose hasTags true
17 silly git-describe.sync "@githubjs/github-contributions@1.0.1-2-g5ff80af" => {"lastTagName":"@githubjs/github-contributions@1.0.1","lastVersion":"1.0.1","refCount":"2","sha":"5ff80af","isDirty":false}
18 info Looking for changed packages since @githubjs/github-contributions@1.0.1
19 silly checking diff packages/github-contributions
20 silly found diff in packages/github-contributions/package.json
21 verbose filtered diff [ 'packages/github-contributions/package.json' ]
22 silly checking diff packages/github-languages
23 silly found diff in packages/github-languages/package.json
24 verbose filtered diff [ 'packages/github-languages/package.json' ]
25 silly checking diff packages/github-trending
26 silly found diff in packages/github-trending/package.json
27 verbose filtered diff [ 'packages/github-trending/package.json' ]
28 verbose updated @githubjs/github-contributions
29 verbose updated @githubjs/github-languages
30 verbose updated @githubjs/github-trending
31 verbose git-describe undefined => "@githubjs/github-contributions@1.0.1-2-g5ff80af"
32 silly git-describe parsed => {"lastTagName":"@githubjs/github-contributions@1.0.1","lastVersion":"1.0.1","refCount":"2","sha":"5ff80af","isDirty":false}
33 silly independent for @githubjs/github-contributions at /Users/ying/workspace/FEProjects/githubjs/packages/github-contributions
34 verbose getChangelogConfig using preset "conventional-changelog-angular"
35 silly npa { type: 'tag',
35 silly npa   registry: true,
35 silly npa   where: undefined,
35 silly npa   raw: 'conventional-changelog-angular',
35 silly npa   name: 'conventional-changelog-angular',
35 silly npa   escapedName: 'conventional-changelog-angular',
35 silly npa   scope: undefined,
35 silly npa   rawSpec: '',
35 silly npa   saveSpec: null,
35 silly npa   fetchSpec: 'latest',
35 silly npa   gitRange: undefined,
35 silly npa   gitCommittish: undefined,
35 silly npa   hosted: undefined }
36 verbose getChangelogConfig Attempting to resolve preset "conventional-changelog-angular"
37 info getChangelogConfig Successfully resolved preset "conventional-changelog-angular"
38 verbose independent increment 1.0.0 by minor
39 silly independent for @githubjs/github-languages at /Users/ying/workspace/FEProjects/githubjs/packages/github-languages
40 verbose independent increment 1.0.0 by minor
41 silly independent for @githubjs/github-trending at /Users/ying/workspace/FEProjects/githubjs/packages/github-trending
42 verbose independent increment 1.0.0 by minor
43 info execute Skipping releases
44 silly lifecycle No script for "preversion" in "root", continuing
45 silly lifecycle No script for "preversion" in "@githubjs/github-contributions", continuing
46 silly lifecycle No script for "preversion" in "@githubjs/github-languages", continuing
47 silly lifecycle No script for "preversion" in "@githubjs/github-trending", continuing
48 silly lifecycle No script for "version" in "@githubjs/github-languages", continuing
49 silly independent for @githubjs/github-languages at /Users/ying/workspace/FEProjects/githubjs/packages/github-languages
50 silly lifecycle No script for "version" in "@githubjs/github-trending", continuing
51 silly independent for @githubjs/github-trending at /Users/ying/workspace/FEProjects/githubjs/packages/github-trending
52 silly lifecycle No script for "version" in "@githubjs/github-contributions", continuing
53 silly independent for @githubjs/github-contributions at /Users/ying/workspace/FEProjects/githubjs/packages/github-contributions
54 silly independent writing new entry: "# [](https://upcwangying.github.com/upcwangying/githubjs/compare/@githubjs/github-languages@1.0.1...@githubjs/github-languages@) (2019-08-13)\n\n\n### Features\n\n* reset ([5ff80af](https://upcwangying.github.com/upcwangying/githubjs/commit/5ff80af))\n* reset ([f8992c3](https://upcwangying.github.com/upcwangying/githubjs/commit/f8992c3))\n\n\n\n"
55 silly independent writing new entry: "# [](https://upcwangying.github.com/upcwangying/githubjs/compare/@githubjs/github-contributions@1.0.1...@githubjs/github-contributions@) (2019-08-13)\n\n\n### Features\n\n* reset ([5ff80af](https://upcwangying.github.com/upcwangying/githubjs/commit/5ff80af))\n* reset ([f8992c3](https://upcwangying.github.com/upcwangying/githubjs/commit/f8992c3))\n\n\n\n"
56 verbose independent wrote /Users/ying/workspace/FEProjects/githubjs/packages/github-languages/CHANGELOG.md
57 silly independent writing new entry: "# [](https://upcwangying.github.com/upcwangying/githubjs/compare/@githubjs/github-trending@1.0.1...@githubjs/github-trending@) (2019-08-13)\n\n\n### Features\n\n* reset ([5ff80af](https://upcwangying.github.com/upcwangying/githubjs/commit/5ff80af))\n* reset ([f8992c3](https://upcwangying.github.com/upcwangying/githubjs/commit/f8992c3))\n\n\n\n"
58 verbose independent wrote /Users/ying/workspace/FEProjects/githubjs/packages/github-contributions/CHANGELOG.md
59 verbose independent wrote /Users/ying/workspace/FEProjects/githubjs/packages/github-trending/CHANGELOG.md
60 silly lifecycle No script for "version" in "root", continuing
61 silly gitAdd [ '/Users/ying/workspace/FEProjects/githubjs/packages/github-languages/package.json',
61 silly gitAdd   '/Users/ying/workspace/FEProjects/githubjs/packages/github-trending/package.json',
61 silly gitAdd   '/Users/ying/workspace/FEProjects/githubjs/packages/github-contributions/package.json',
61 silly gitAdd   '/Users/ying/workspace/FEProjects/githubjs/packages/github-languages/CHANGELOG.md',
61 silly gitAdd   '/Users/ying/workspace/FEProjects/githubjs/packages/github-contributions/CHANGELOG.md',
61 silly gitAdd   '/Users/ying/workspace/FEProjects/githubjs/packages/github-trending/CHANGELOG.md' ]
62 silly gitCommit Publish
62 silly gitCommit
62 silly gitCommit  - @githubjs/github-contributions@1.1.0
62 silly gitCommit  - @githubjs/github-languages@1.1.0
62 silly gitCommit  - @githubjs/github-trending@1.1.0
63 verbose git [ 'commit',
63 verbose git   '-F',
63 verbose git   '/private/var/folders/22/1cgz_7p93fz3rr2n5_vgqg_c0000gn/T/8a015052-672f-4716-bc57-0e72a79b5528/lerna-commit.txt' ]
64 silly gitTag @githubjs/github-contributions@1.1.0
65 verbose git [ 'tag',
65 verbose git   '@githubjs/github-contributions@1.1.0',
65 verbose git   '-m',
65 verbose git   '@githubjs/github-contributions@1.1.0' ]
66 silly gitTag @githubjs/github-languages@1.1.0
67 verbose git [ 'tag',
67 verbose git   '@githubjs/github-languages@1.1.0',
67 verbose git   '-m',
67 verbose git   '@githubjs/github-languages@1.1.0' ]
68 silly gitTag @githubjs/github-trending@1.1.0
69 verbose git [ 'tag',
69 verbose git   '@githubjs/github-trending@1.1.0',
69 verbose git   '-m',
69 verbose git   '@githubjs/github-trending@1.1.0' ]
70 silly lifecycle No script for "postversion" in "@githubjs/github-contributions", continuing
71 silly lifecycle No script for "postversion" in "@githubjs/github-languages", continuing
72 silly lifecycle No script for "postversion" in "@githubjs/github-trending", continuing
73 silly lifecycle No script for "postversion" in "root", continuing
74 info git Pushing tags...
75 silly gitPush origin master
76 info publish Publishing packages to npm...
77 info Verifying npm credentials
78 verbose Retrieving npm user profile
79 http fetch GET 200 https://registry.npmjs.org/-/npm/v1/user 1321ms
80 silly npm profile get received {"tfa":false,"name":"upcwangying","email":"upcwangying@126.com","email_verified":true,"created":"2017-12-29T15:43:55.834Z","updated":"2018-08-03T05:30:49.459Z","cidr_whitelist":null,"fullname":"Ying Wang","homepage":"http://www.upcwangying.com","freenode":"","twitter":"","github":"upcwangying"}
81 silly get npm username received {"username":"upcwangying","tfa":false,"name":"upcwangying","email":"upcwangying@126.com","email_verified":true,"created":"2017-12-29T15:43:55.834Z","updated":"2018-08-03T05:30:49.459Z","cidr_whitelist":null,"fullname":"Ying Wang","homepage":"http://www.upcwangying.com","freenode":"","twitter":"","github":"upcwangying"}
82 silly verifyNpmPackageAccess
83 http fetch GET 200 https://registry.npmjs.org/-/org/upcwangying/package?format=cli 408ms
84 info Checking two-factor auth mode
85 verbose Retrieving npm user profile
86 http fetch GET 200 https://registry.npmjs.org/-/npm/v1/user 323ms
87 silly npm profile get received {"tfa":false,"name":"upcwangying","email":"upcwangying@126.com","email_verified":true,"created":"2017-12-29T15:43:55.834Z","updated":"2018-08-03T05:30:49.459Z","cidr_whitelist":null,"fullname":"Ying Wang","homepage":"http://www.upcwangying.com","freenode":"","twitter":"","github":"upcwangying"}
88 silly 2FA false
89 silly getCurrentSHA
90 verbose getCurrentSHA 2f1203ef18dd9f0fb71cfe90411cab7a2cb371aa
91 silly lifecycle No script for "prepublish" in "root", continuing
92 silly lifecycle No script for "prepare" in "root", continuing
93 silly lifecycle No script for "prepublishOnly" in "root", continuing
94 silly lifecycle No script for "prepack" in "root", continuing
95 verbose pack-directory packages/github-contributions
96 verbose pack-directory packages/github-languages
97 verbose pack-directory packages/github-trending
98 silly lifecycle No script for "prepublish" in "@githubjs/github-contributions", continuing
99 silly lifecycle No script for "prepublish" in "@githubjs/github-languages", continuing
100 silly lifecycle No script for "prepublish" in "@githubjs/github-trending", continuing
101 silly lifecycle No script for "prepare" in "@githubjs/github-contributions", continuing
102 silly lifecycle No script for "prepare" in "@githubjs/github-languages", continuing
103 silly lifecycle No script for "prepare" in "@githubjs/github-trending", continuing
104 silly lifecycle No script for "prepublishOnly" in "@githubjs/github-contributions", continuing
105 silly lifecycle No script for "prepublishOnly" in "@githubjs/github-trending", continuing
106 silly lifecycle No script for "prepublishOnly" in "@githubjs/github-languages", continuing
107 silly lifecycle No script for "prepack" in "@githubjs/github-contributions", continuing
108 silly lifecycle No script for "prepack" in "@githubjs/github-trending", continuing
109 silly lifecycle No script for "prepack" in "@githubjs/github-languages", continuing
110 silly lifecycle No script for "postpack" in "@githubjs/github-contributions", continuing
111 verbose packed packages/github-contributions
112 silly lifecycle No script for "postpack" in "@githubjs/github-languages", continuing
113 verbose packed packages/github-languages
114 silly lifecycle No script for "postpack" in "@githubjs/github-trending", continuing
115 verbose packed packages/github-trending
116 silly lifecycle No script for "postpack" in "root", continuing
117 verbose publish @githubjs/github-contributions
118 verbose publish @githubjs/github-languages
119 verbose publish @githubjs/github-trending
120 error TypeError: this[method] is not a function
120 error     at GitHost.toString (/Users/ying/workspace/FEProjects/githubjs/node_modules/hosted-git-info/git-host.js:154:22)
120 error     at Object.fixRepositoryField (/Users/ying/workspace/FEProjects/githubjs/node_modules/normalize-package-data/lib/fixer.js:31:87)
120 error     at /Users/ying/workspace/FEProjects/githubjs/node_modules/normalize-package-data/lib/normalize.js:32:38
120 error     at Array.forEach (<anonymous>)
120 error     at normalize (/Users/ying/workspace/FEProjects/githubjs/node_modules/normalize-package-data/lib/normalize.js:31:15)
120 error     at final (/Users/ying/workspace/FEProjects/githubjs/node_modules/read-package-json/read-json.js:411:5)
120 error     at then (/Users/ying/workspace/FEProjects/githubjs/node_modules/read-package-json/read-json.js:160:5)
120 error     at /Users/ying/workspace/FEProjects/githubjs/node_modules/read-package-json/read-json.js:280:12
120 error     at /Users/ying/workspace/FEProjects/githubjs/node_modules/graceful-fs/graceful-fs.js:90:16

Context

Your Environment

Executable Version
lerna --version 3.16.4
npm --version 6.9.0
yarn --version 1.16.0
node --version v10.16.0
OS Version
macOS Mojave 10.14.6
@evocateur

This comment has been minimized.

Copy link
Member

commented Aug 14, 2019

Where is this code located? What do the repository fields of your leaf packages look like?

The root of this error is external to lerna, located in hosted-git-info (which is used by one of lerna's direct dependencies in this case, npm-package-arg).

@upcwangying

This comment has been minimized.

Copy link
Author

commented Aug 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.