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!