Create-react-app: Unable to create application because name contains uppercase letters

Created on 15 May 2017  路  8Comments  路  Source: facebook/create-react-app

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?

All 8 comments

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

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 :)

I鈥檓 glad you found a workaround.

I am hesitant because npm explicitly disallows this (I can鈥檛 even run npm init with a capitalized name). I understand it doesn鈥檛 matter if you don鈥檛 publish, but it鈥檚 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鈥檚 just not worth the maintenance risks and costs to me.

If it truly hinders your productivity, I鈥檓 sorry. IMO there are more important things to stress over, and I wouldn鈥檛 spend too much energy on folder naming 馃槈 .

@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?

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).

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

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

This is really annoying

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fson picture fson  路  3Comments

JimmyLv picture JimmyLv  路  3Comments

jnachtigall picture jnachtigall  路  3Comments

adrice727 picture adrice727  路  3Comments

alleroux picture alleroux  路  3Comments