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

Unable to create application because name contains uppercase letters #2165

Closed
alexmcmillan opened this issue May 15, 2017 · 8 comments
Closed

Comments

@alexmcmillan
Copy link

alexmcmillan commented May 15, 2017

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?

@gaearon
Copy link
Contributor

gaearon commented 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.

@alexmcmillan
Copy link
Author

alexmcmillan commented May 15, 2017

As a Windows user developing an application, this restriction does nothing for me and hinders my usage of this awesome tool.

I've edited create-react-app locally to remove this requirement so I could create my own application; I put this here in hope of improving/contributing to an already-excellent tool. Take from it what you will :)

@gaearon
Copy link
Contributor

gaearon commented 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 😉 .

@gaearon gaearon closed this as completed May 15, 2017
@alexmcmillan
Copy link
Author

@gaearon:

I work in a predominantly MS-tech-centric company and repeatedly bang my head against this wall (colleagues can get really ruffled feathers over trivial things like this).

I note npm init -f inside a folder containing a capital name creates a project without complaining, and all the build tools (at least the ones I use) work fine.

Perhaps we could add a -f flag for create-react-app? This would allow the desired behaviour, but only when explicitly requested (avoiding confusion).

Thoughts?

@Timer
Copy link
Contributor

Timer commented Jul 20, 2017

What's wrong with manually renaming it after? I don't see why we'd want to add a flag when you can simply rename the folder (and people seldom create apps).

@alexmcmillan
Copy link
Author

Sorry I was just enquiring; it's not worth arguing for.

@Timer
Copy link
Contributor

Timer commented Jul 20, 2017

Sorry, I hope I didn't come off harsh due to my tersity. 😰

@philwinkel
Copy link

This is really annoying

@facebook facebook locked as spam and limited conversation to collaborators Feb 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants