You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to create application because name contains uppercase letters #2165
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.
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?
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.
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 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 😉 .
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).
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).
Activity
gaearon commentedon 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 commentedon 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-applocally 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 commentedon May 15, 2017
I’m glad you found a workaround.
I am hesitant because npm explicitly disallows this (I can’t even run
npm initwith a capitalized name). I understand it doesn’t matter if you don’t publish, but it’s going to be confusing for:Also, who knows if some future version of
npmwill even support runningnpm installin such folders. Or if it becomes buggy because this way of doing things is clearly neglected / frowned upon by thenpmclient.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 😉 .
alexmcmillan commentedon Jul 20, 2017
@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 -finside 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
-fflag forcreate-react-app? This would allow the desired behaviour, but only when explicitly requested (avoiding confusion).Thoughts?
Timer commentedon 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 commentedon Jul 20, 2017
Sorry I was just enquiring; it's not worth arguing for.
Timer commentedon Jul 20, 2017
Sorry, I hope I didn't come off harsh due to my tersity. 😰
philwinkel commentedon Feb 14, 2018
This is really annoying