Cannot install frontity with npx frontity create my-app

Hi,
Iā€™ve a problem with the frontity installation, since itā€™s giving me an error on a Windows machine.

I use this machine for random developing while travelling and I need to keep it on Windows, but I never had problems with react apps before (as example: npx create-react-app myapp works fine).

NPX is giving me this error (screenshot attached) and Iā€™ve to say.
Iā€™m lost, whatā€™s up?

C:\esercizi\react>npx frontity create my-app && cd my-app

Error: EEXIST: file already exists, mkdir ā€˜C:\Users\Matteoā€™
TypeError: Cannot read property ā€˜loadedā€™ of undefined
at exit (C:\nvm\v12.14.0\node_modules\npm\lib\utils\error-handler.js:97:27)
at errorHandler (C:\nvm\v12.14.0\node_modules\npm\lib\utils\error-handler.js:216:3)
at C:\nvm\v12.14.0\node_modules\npm\bin\npm-cli.js:78:20
at cb (C:\nvm\v12.14.0\node_modules\npm\lib\npm.js:225:22)
at C:\nvm\v12.14.0\node_modules\npm\lib\npm.js:263:24
at C:\nvm\v12.14.0\node_modules\npm\lib\config\core.js:81:7
at Array.forEach ()
at C:\nvm\v12.14.0\node_modules\npm\lib\config\core.js:80:13
at f (C:\nvm\v12.14.0\node_modules\npm\node_modules\once\once.js:25:25)
at afterExtras (C:\nvm\v12.14.0\node_modules\npm\lib\config\core.js:171:20)
C:\nvm\v12.14.0\node_modules\npm\lib\utils\error-handler.js:97
var doExit = npm.config.loaded ? npm.config.get(ā€™_exitā€™) : true
^

TypeError: Cannot read property ā€˜loadedā€™ of undefined
at exit (C:\nvm\v12.14.0\node_modules\npm\lib\utils\error-handler.js:97:27)
at process.errorHandler (C:\nvm\v12.14.0\node_modules\npm\lib\utils\error-handler.js:216:3)
at process.emit (events.js:210:5)
at process._fatalException (internal/process/execution.js:150:25)
Install for [ ā€˜frontity@latestā€™ ] failed with code 7

Hi!

Have you tried to update your node version?

Regards

Hi @matteo.morreale !

It seems very much like an issue with node rather than a problem with frontity itself.

In the second screenshot you seem to have run npx frontity frontity-app, but the frontity commad requires an argument like create, create-package, etc. In this case, frontity should have just printed out the help like:

Unknown command: frontity-app

Usage: frontity <command> [options]

Frontity CLI

Options:
  -V, --version                    output the version number
  -h, --help                       output usage information

Commands:
  create [options] [name]          Creates a new Frontity project.
  create-package [options] [name]  Creates a new Frontity package in a project.
  dev [options]                    Starts a server in development mode.
  build [options]                  Builds the project for production.
  serve [options]                  Starts a server in production mode.
  subscribe <email>                Subscribe to Frontity newsletter.
  info                             Get environment information for debugging and issue reporting.

Could you try to following:

  1. clean the npm cache
    try again
  2. reinstall npm
    try again
  3. check your node installation and reinstall node.

Let us know if youā€™ve managed to solve the problem, cheers :slight_smile:

Hi!
Sorry, Iā€™ve tried many times and in this one Iā€™ve lost part of the command but it does not work with create.
Iā€™ve tried by updating npm and clearing the cache but still nothing works,!
Node is on the v12.14.1 now, it was on the v12.14.0 before but still itā€™s not working.

On Linux Iā€™d no problem at all but this is a Windows pc.

Does npm itself work correctly? Could you run some other npm command, e.g.: npm info react?

A quick google search tells me that it might be a problem with user permissions for node/npm: https://stackoverflow.com/questions/42678759/npm-error-on-every-command-eexist-file-already-exists-mkdir-c-users-user-ap

Yes, thatā€™s the odd situationā€¦ other commands works fine, only frontity fails.

Thatā€™s the npx create react app, all working fine

Not a fix butā€¦ Iā€™ve ā€œsolvedā€ by installing linux even on this machine.
Still donā€™t know why it wasnā€™t working on Windows butā€¦ Iā€™ve used as an incentive to move this PC to linux. :rofl:

Haha, glad you ā€œsolvedā€ it then :upside_down_face:

@matteo.morreale is this a problem with npx frontity or only with npx frontity create? What happens if you try npx frontity info?

Hi, sorry if Iā€™ve delayed my reply but I was working on Linux environment and I wasnā€™t able to move to Windows :slight_smile:

Same error on npx frontity info:

Other commands, not frontity one, still works fine.

It certainly looks like the npx problem with spaces in the user name: Mateo Morreale.

I donā€™t understand why npx create-react-app works. Did you install it globally? Does it work with create-react-app (no npx)?

You can solve the npx problem with spaces with these instructions:

Hi luish,
no I havenā€™t installed it globally, really I donā€™t know why itā€™s working but all other npx commands are working, only frontity gave me this error here in Windows 10.

Tried what you said in this other post and itā€™s working like a charm, thank you :slight_smile:

Ok, maybe thereā€™s something we can do to fix this in our side. For what I see, create-react-app also should have this problem: https://github.com/facebook/create-react-app/issues/4058 so I donā€™t understand why itā€™s working in your caseā€¦

Iā€™d love to help but I donā€™t have the skills to do that, sorry :frowning:
By the way in the meantime Iā€™ve switched to Linux so now Iā€™m working on that environment, I cannot even profusely test it anymoreā€¦

No problem Mateo, Iā€™m glad that at least itā€™s solved in your Windows environment :slight_smile:

Awesome Luis :raised_hands:, I am new ā€¦trying frontity for the first time to see if I can implement it in my job, and I had the same problem but your post about fixing itā€¦solve it for meā€¦thanks!

3 Likes

Awesome :slightly_smiling_face:

I wonder when npm is planning to fix that. Microsoft now owns both Windows and NPM!