Yarn: error An unexpected error occurred: "Invalid number of spaces".

Created on 4 Apr 2018  路  7Comments  路  Source: yarnpkg/yarn


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

triaged

Most helpful comment

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

All 7 comments

You probably have an invalid lockfile or npmrc.

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

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

_

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

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

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.

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

Thanks! That seem to do the trick!

Was this page helpful?
0 / 5 - 0 ratings