question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't install Lerna!

See original GitHub issue

Hello, I’m facing some issues with lerna installation.

image

Expected Behavior

Lerna is installed and can be used

Current Behavior

An error occurs when I try to install lerna and I can’t use it.

Steps to Reproduce (for bugs)

  1. npm i -g lerna
npm-debug.log

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   '/usr/local/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'i',
1 verbose cli   '--global',
1 verbose cli   'lerna@3.18.3'
1 verbose cli ]
2 info using npm@6.12.0
3 info using node@v13.0.1
4 verbose npm-session 6f97f9740302339a
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 304 https://registry.npmjs.org/lerna 2483ms (from cache)
8 silly pacote version manifest for lerna@3.18.3 fetched in 2500ms
9 timing stage:loadCurrentTree Completed in 2509ms
10 silly install loadIdealTree
11 silly install cloneCurrentTreeToIdealTree
12 timing stage:loadIdealTree:cloneCurrentTree Completed in 0ms
13 silly install loadShrinkwrap
14 timing stage:loadIdealTree:loadShrinkwrap Completed in 1ms
15 silly install loadAllDepsIntoIdealTree
16 silly resolveWithNewModule lerna@3.18.3 checking installable status
17 http fetch GET 200 https://registry.npmjs.org/@lerna%2fdiff 20ms (from cache)
18 http fetch GET 200 https://registry.npmjs.org/@lerna%2fcli 23ms (from cache)
19 http fetch GET 200 https://registry.npmjs.org/@lerna%2fimport 19ms (from cache)
20 http fetch GET 200 https://registry.npmjs.org/@lerna%2finit 20ms (from cache)
21 http fetch GET 200 https://registry.npmjs.org/@lerna%2fclean 26ms (from cache)
22 http fetch GET 200 https://registry.npmjs.org/@lerna%2fcreate 26ms (from cache)
23 http fetch GET 200 https://registry.npmjs.org/@lerna%2fbootstrap 29ms (from cache)
24 silly pacote version manifest for @lerna/diff@3.18.0 fetched in 27ms
25 silly resolveWithNewModule @lerna/diff@3.18.0 checking installable status
26 silly pacote version manifest for @lerna/cli@3.18.0 fetched in 30ms
27 silly resolveWithNewModule @lerna/cli@3.18.0 checking installable status
28 silly pacote version manifest for @lerna/import@3.18.0 fetched in 29ms
29 silly resolveWithNewModule @lerna/import@3.18.0 checking installable status
30 silly pacote version manifest for @lerna/init@3.18.0 fetched in 27ms
31 silly resolveWithNewModule @lerna/init@3.18.0 checking installable status
32 silly pacote version manifest for @lerna/clean@3.18.0 fetched in 35ms
33 silly resolveWithNewModule @lerna/clean@3.18.0 checking installable status
34 silly pacote version manifest for @lerna/create@3.18.0 fetched in 34ms
35 silly resolveWithNewModule @lerna/create@3.18.0 checking installable status
36 silly pacote version manifest for @lerna/bootstrap@3.18.0 fetched in 39ms
37 silly resolveWithNewModule @lerna/bootstrap@3.18.0 checking installable status
38 http fetch GET 200 https://registry.npmjs.org/@lerna%2flink 18ms (from cache)
39 http fetch GET 200 https://registry.npmjs.org/@lerna%2flist 19ms (from cache)
40 http fetch GET 200 https://registry.npmjs.org/@lerna%2fpublish 18ms (from cache)
41 silly fetchPackageMetaData error for @lerna/publish@3.18.3 Unexpected end of JSON input while parsing near '...7.1","@lerna/run-life'
42 silly pacote version manifest for @lerna/link@3.18.0 fetched in 23ms
43 silly resolveWithNewModule @lerna/link@3.18.0 checking installable status
44 silly pacote version manifest for @lerna/list@3.18.0 fetched in 22ms
45 silly resolveWithNewModule @lerna/list@3.18.0 checking installable status
46 http fetch GET 304 https://registry.npmjs.org/npmlog 636ms (from cache)
47 silly pacote range manifest for npmlog@^4.1.2 fetched in 637ms
48 silly resolveWithNewModule npmlog@4.1.2 checking installable status
49 http fetch GET 304 https://registry.npmjs.org/import-local 666ms (from cache)
50 silly pacote range manifest for import-local@^2.0.0 fetched in 668ms
51 silly resolveWithNewModule import-local@2.0.0 checking installable status
52 http fetch GET 304 https://registry.npmjs.org/@lerna%2fadd 718ms (from cache)
53 silly pacote version manifest for @lerna/add@3.18.0 fetched in 721ms
54 silly resolveWithNewModule @lerna/add@3.18.0 checking installable status
55 http fetch GET 304 https://registry.npmjs.org/@lerna%2fversion 697ms (from cache)
56 silly pacote version manifest for @lerna/version@3.18.3 fetched in 698ms
57 silly resolveWithNewModule @lerna/version@3.18.3 checking installable status
58 http fetch GET 304 https://registry.npmjs.org/@lerna%2fexec 813ms (from cache)
59 silly pacote version manifest for @lerna/exec@3.18.0 fetched in 814ms
60 silly resolveWithNewModule @lerna/exec@3.18.0 checking installable status
61 http fetch GET 304 https://registry.npmjs.org/@lerna%2frun 1693ms (from cache)
62 silly pacote version manifest for @lerna/run@3.18.0 fetched in 1695ms
63 silly resolveWithNewModule @lerna/run@3.18.0 checking installable status
64 http fetch GET 304 https://registry.npmjs.org/@lerna%2fchanged 1948ms (from cache)
65 silly pacote version manifest for @lerna/changed@3.18.3 fetched in 1950ms
66 silly resolveWithNewModule @lerna/changed@3.18.3 checking installable status
67 timing stage:rollbackFailedOptional Completed in 0ms
68 timing stage:runTopLevelLifecycles Completed in 4472ms
69 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...7.1","@lerna/run-life'
69 verbose stack     at JSON.parse (<anonymous>)
69 verbose stack     at parseJson (/usr/local/lib/node_modules/npm/node_modules/json-parse-better-errors/index.js:7:17)
69 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/node-fetch-npm/src/body.js:96:50
69 verbose stack     at processTicksAndRejections (internal/process/task_queues.js:93:5)
70 verbose cwd /Volumes/Workspace/pets/cast-calls/cast-calls
71 verbose Darwin 19.0.0
72 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "i" "--global" "lerna@3.18.3"
73 verbose node v13.0.1
74 verbose npm  v6.12.0
75 error Unexpected end of JSON input while parsing near '...7.1","@lerna/run-life'
76 verbose exit [ 1, true ]

Executable Version
lerna --version can’t install
npm --version 6.12.0
node --version 13.0.1
OS Version
macOS Catalina 10.15 (19A583)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
evocateurcommented, Oct 25, 2019

You need to clear your global npm cache, it would seem. https://docs.npmjs.com/cli/cache.html

0reactions
MikeYermolayevcommented, Oct 25, 2019

yep. just did it and it helped me. Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting | Lerna
Troubleshooting. This document contains solutions for certain issues our users encountered in the past while using Lerna.
Read more >
Install error with lerna and yarn workspace - Stack Overflow
The first command you've tried seems to be right, check your package.json files, maybe it was already declared. You can also try adding...
Read more >
@lerna/bootstrap - npm
Bootstrap the packages in the current Lerna repo. Installs all of their dependencies and links any cross-dependencies. When run, this command will:.
Read more >
Lerna NPM | npm.io
Lerna won't publish packages which are marked as private ( "private": true in the package.json ). Note: to publish scoped packages, you need...
Read more >
Can't add local package in a monorepo lerna project - Support
I need advice to debug deploy Netlify App. Hi people! I have a monorepo that uses yarn workspaces + lerna. In my “frontend”...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found