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

error An unexpected error occurred: "Invalid number of spaces". #5613

Open
wiston-mwinzi opened this issue Apr 4, 2018 · 11 comments
Open

error An unexpected error occurred: "Invalid number of spaces". #5613

wiston-mwinzi opened this issue Apr 4, 2018 · 11 comments
Assignees
Labels

Comments

@wiston-mwinzi
Copy link

Yarn version:
1.5.1

Do you want to request a feature or report a bug?

bug

What is the current behavior?
error An unexpected error occurred: "Invalid number of spaces".

If the current behavior is a bug, please provide the steps to reproduce.

error during yarn install on window 10

What is the expected behavior?
Install packages

Please mention your node.js, yarn and operating system version.
**Yarn version:
1.5.1

Node version:
9.3.0

Platform:
win32 x64**

----------------- More Info -----------
Trace:
TypeError: Invalid number of spaces
at tokenise (D:\Installs\Yarn\lib\cli.js:61849:17)
at tokenise.next ()
at Parser.next (D:\Installs\Yarn\lib\cli.js:61961:28)
at Parser.parse (D:\Installs\Yarn\lib\cli.js:62009:30)
at parse (D:\Installs\Yarn\lib\cli.js:62182:17)
at module.exports.exports.default (D:\Installs\Yarn\lib\cli.js:61746:96)
at YarnRegistry. (D:\Installs\Yarn\lib\cli.js:92468:64)
at Generator.next ()
at step (D:\Installs\Yarn\lib\cli.js:98:30)
at D:\Installs\Yarn\lib\cli.js:109:13

---------------------- cli -------------------------

cli.zip

@ghost ghost assigned torifat Apr 4, 2018
@ghost ghost added the triaged label Apr 4, 2018
@arcanis
Copy link
Member

arcanis commented Apr 4, 2018

You probably have an invalid lockfile or npmrc.

@wiston-mwinzi
Copy link
Author

What does the invalid lockfile or npmrc mean and how can i resolve this?

@wiston-mwinzi
Copy link
Author

This even happens when i do below

yarn init

I get

λ yarn init
yarn init v1.5.1
error An unexpected error occurred: "Invalid number of spaces".
info If you think this is a bug, please open a bug report with the information provided in "E:\PROJECTS\\myApp\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/init for documentation about this command.

attached _yarn-error.log
yarn-error.log

_

mihai-macaneata added a commit to eea/fise.nfi.search that referenced this issue May 24, 2018
@mike2004
Copy link

I'm experiencing the same issue! Is there a fix or workaround for this?

@navinesh
Copy link

I managed to get this working by deleting yarn.lock file and running yarn install

@dmt0
Copy link

dmt0 commented Dec 14, 2018

Why can't yarn tell me which line has this problem? I get the yarn-error.log, it has the whole package.json and the whole yarn.lock file in there, but nothing about the actual error that occured.

@jeffleu
Copy link

jeffleu commented Feb 24, 2020

I managed to get this working by deleting yarn.lock file and running yarn install

Thanks! That seem to do the trick!

@ab-rnjn
Copy link

ab-rnjn commented Feb 22, 2021

The issue occurs when the is some extra space in any particular line for yarn.lock file. A formatter for lock file will resolve this issue if you don't want to delete the lock file.

@sammerset
Copy link

The issue can occurs when the is some extra space in your .yarnrc file too

@veniti
Copy link

veniti commented Jun 6, 2022

@ab-rnjn do you recommend any? prettier tells me that it can't format plaintext

@watermirror1107
Copy link

Remove the yarn.lock and install again, it can resolve your problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests