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.

Unable to create application because name contains uppercase letters

See original GitHub issue

NPM packages are not allowed upper case characters in their name, seemingly because unix filesystems are case-sensitive, which creates “a recipe for confusion and nonportable software”.

This makes perfect sense in the context of libraries intended as portable software; however, not so much when speaking about end-of-the-line applications, especially those developed in a case-insensitive environment like Windows.

PR1652 introduced project name validation using validate-npm-package-name, assumedly to avoid issues with output displaying spaces in names.

Should “React applications”, being a different (eg: less focused on “portability”) category of software, have these same restrictions?

For example, I am not trying to make an npm package / library. I am trying to use create-react-app to generate an application, and I need to follow application naming conventions in my company which requires the use of capital letters in the application name.

> create-react-app MyApp

Could not create a project called "MyApp" because of npm naming restrictions:
  * name can no longer contain capital letters

Why does this restriction need to apply to react applications / create-react-app and, if it doesn’t, can this solution to #1649 be reconsidered? Perhaps with a subset of the npm restrictions more suited to applications?

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
gaearoncommented, May 15, 2017

I’m glad you found a workaround.

I am hesitant because npm explicitly disallows this (I can’t even run npm init with a capitalized name). I understand it doesn’t matter if you don’t publish, but it’s going to be confusing for:

  • People who do want to publish
  • People who later transition to a monorepo and start having issues with case sensitivity

Also, who knows if some future version of npm will even support running npm install in such folders. Or if it becomes buggy because this way of doing things is clearly neglected / frowned upon by the npm client.

So it’s just not worth the maintenance risks and costs to me.

If it truly hinders your productivity, I’m sorry. IMO there are more important things to stress over, and I wouldn’t spend too much energy on folder naming 😉 .

2reactions
gaearoncommented, May 15, 2017

I see your point but I don’t think it’s worth complicating the validation logic with special cases like this. There’s no uppercase name that can’t be converted to the-way-npm-likes-it, and while you’re right it probably doesn’t matter in this case, I don’t see enough benefit to allow otherwise.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why can't React project name contain capital letters?
I am trying to use create-react-app to generate an application, and I need to ... It's mostly because NPM doesn't allow capital letters....
Read more >
Unable to create Application Insights resource when name ...
The name I'm using is one I have been using for some time which is comprised of thirteen uppercase characters and two digits...
Read more >
Re-registering a host with hostname having uppercase letters ...
Re-registering a host with hostname having uppercase letters in Red Hat Satellite 6 fails with an error Name has already been taken.
Read more >
Text always types in uppercase letters in AutoCAD
Type regedit and press Enter. Go to: Computer\HKEY_CURRENT_USER\Software\Autodesk\AutoCAD LT\<release>\ACADLT-<product code>\<Profile name> ...
Read more >
JavaScript toLowerCase() – How to Convert a String to ...
This article explains how to convert a string to lowercase and uppercase characters. We'll also go over how to make only the first...
Read more >

github_iconTop Related Medium Post

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