Do you want to request a feature or report a bug?
report a bug
What is the current behavior?
After running 'yarn start', i get the following error message:
error An unexpected error occurred: "Cannot create property '-bacem-ghali-mypassword-myproxy-8080' on string 'http://bacem.ghali:mypassword@myproxy:8080'".
If the current behavior is a bug, please provide the steps to reproduce.
run 'yarn start'
What is the expected behavior?
yarn should run my frontend on webpack
Please mention your node.js, yarn and operating system version.
node.js: v6.9.4
yarn: 1.0.2
OS: windows 10
yarn start just triggers your start script. This looks like a problem with your start script.
I just ran into this issue and found the problem.
Check your npm config list. If you see a property for bacem-ghali-mypassword-myproxy-8080, run npm config delete bacem-ghali-mypassword-myproxy-8080. (Unless you really need it, of course - but I'm guessing you don't).
That cleared up our issue. No clue though how the rogue config property was created in the first place, though.
Just wanted to document my issue as well, I kept getting this error:
An unexpected error occurred: "Cannot create property 'usr-bin-python2' on string '{\"usr-bin-python2\":true}'".
I recently migrated from archlinux to mac os and in my previous setup I manually set the python2 path in my .npmrc to where archlinux installs it by default (since python in arch defaults to python3).
TLDR: if you happen to get the error mentioned 2 lines above, check your .npmrc file and update or remove the python2 entry
In my case the error was similar, due to the existence of a wrongly formatted .npmrc file.
% yarn run <custom-script>
yarn run v1.13.0
...
error An unexpected error occurred: "Cannot create property '-https' on string 'https://registry.custom.tld/'".
info If you think this is a bug, please open a bug report with the information provided in "/Users/stef/some/path/to/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The problem was due to a misconfiguration from an .npmrc file in my folder hierarchy. I use one to configure the usage of a custom registry, - 'https://registry.custom.tld/' -, for a project with multiple modules.
The npmrc was not correctly configured, and in my case the problem was just to change from
# .npmrc custom made in the folder above
registry: 'https://registry.custom.tld/'
Instead of
# .npmrc custom made in the folder above
registry = 'https://registry.custom.tld/'
The difference is the visible in the yarn configuration.
% yarn config list
yarn config v1.15.2
info yarn config
{ 'version-tag-prefix': 'v',
// ...
registry: 'https://registry.custom.tld/',
// ...
}
info npm config
{ // ...
'registry: "https://registry.custom.tld/"': true } // <-- HERE the error
% yarn config list
yarn config v1.15.2
info yarn config
{ 'version-tag-prefix': 'v',
// ...
registry: 'https://registry.custom.tld/',
// ...
}
info npm config
{ // ...
registry: 'https://registry.custom.tld/' } // <-- HERE it's now correct
The error was only due to a misconfigured .npmrc file. The error was not evident to find !
Some yarn commands would work correctly while some would failed with the Cannot create property '-https' on string ... error.
For me it was also misconfigured npm config that yarn was later consuming.
I had following entry displayed by yarn config, from npm config:
'C:\\Users\\kuzir\\.windows-build-tools\\python27\\python.exe': '',
I ran npm config delete and passed that entry, after it was deleted from npmconfig, I could successfully run yarn command again.
I ran into a similar problem where I used yarn with three layers of nesting. But I can nest two layers. For the same function, separate execution will not cause this problem.
I ran into a similar problem where I used yarn with three layers of nesting. But I can nest two layers. For the same function, separate execution will not cause this problem.
This was exactly my error. I reproduced it in this sample: https://github.com/apottere/yarn-issue-4492
=> yarn run works
yarn run v1.22.0
$ yarn
[1/4] 🔍 Resolving packages...
success Already up-to-date.
✨ Done in 0.35s.
=> yarn run error
yarn run v1.22.0
$ yarn run works
$ yarn
error An unexpected error occurred: "Cannot create property '-artifactory-<redacted>-artifactory-api-npm' on string '{\"-artifactory-<redacted>-artifactory-api-npm\":{\"username\":\"<redacted>\",\"password\":\"<redacted>\"}}'".
info If you think this is a bug, please open a bug report with the information provided in "./yarn-error/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Most helpful comment
I just ran into this issue and found the problem.
Check your
npm config list. If you see a property forbacem-ghali-mypassword-myproxy-8080, runnpm config delete bacem-ghali-mypassword-myproxy-8080. (Unless you really need it, of course - but I'm guessing you don't).That cleared up our issue. No clue though how the rogue config property was created in the first place, though.