Error running npx

Hi guys

I’m getting this error in npx frontity dev --port 4000. I hope if you help me.

thanks

E:\frontity\AppOne>npx frontity dev --port 4000

Error: Cannot find module 'E:\frontity\AppOne/frontity.settings'

If you need help please visit https://community.frontity.org/.

E:\frontity\AppOne>

Hey @saad, welcome to the community :slight_smile:

Could you please paste here your frontity.settings.js file and also paste the result of npx frontity info (run in the root folder of the project)?

Thank you @luisherranz

I’m sorry but I can’t find " frontity.settings.js "

E:\frontity\AppOne>npx frontity info

## System:
 - OS: Windows 10
 - CPU: (4) x64 Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz
 - Memory: 5.65 GB / 15.96 GB
## Binaries:
 - Node: 10.16.2 - C:\Program Files\nodejs\node.EXE
 - npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
## Browsers:
 - Edge: 44.17763.1.0
 - Internet Explorer: Not Found
## npmPackages:
 - @frontity/core: ^1.2.0 => 1.2.0
 - cordova-android: ^8.0.0 => 8.0.0
 - cordova-plugin-whitelist: ^1.3.4 => 1.3.4
 - cordova-plugin-whitelist-tests:  1.3.4
 - framework7: ^4.4.10 => 4.4.10
 - frontity: ^1.3.0 => 1.3.0
## npmGlobalPackages:
 - frontity: Not Found
 - npx: Not Found


  System info copied in the clipboard!
  You can now paste it in the Frontity Community or GitHub issue.

Did you use the command npx frontity create to create the project?

Like we explain here:
https://docs.frontity.org/getting-started/quick-start-guide

Yes I did

Could you please try again in a new folder and confirm if a frontity.settings.js file is created?

I tried to do it again but I have another problem,

E:\Frontity>npx frontity create app
npm ERR! code ENOLOCAL
npm ERR! Could not install from "Faris\AppData\Roaming\npm-cache\_npx\10552" as it does not contain a package.json file.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Saad Faris\AppData\Roaming\npm-cache\_logs\2019-08-31T14_04_57_615Z-debug.log
Install for frontity@latest failed with code 1

It seems like it is a problem of npx when the user folder contains an space (Saad Faris)

It’s crazy that they haven’t solved it yet.

You need to move the npm cache to a folder without spaces.

First, open cmd as Administrator.

  • Search for cmd
  • Right click
  • Choose “Run as Administraror”
  • Enter your password

Then enter these commands in the console:

> mklink /J "C:\Users\saad-faris" "C:\Users\Saad Faris"
> npm config set cache C:\Users\saad-faris\AppData\Roaming\npm-cache
> npm config set prefix C:\Users\saad-faris\AppData\Roaming\npm
> npm cache clean --force

Let me know if that solves all the problems you’re facing.

@luisherranz thank you for your time. It’s working very good :grin:

2 Likes

Awesome. Thanks for this. This solved my issue.

I don’t understand why npm doesn’t solve this issue :sweat:

@robsimmtech welcome to the community!

This resolved my issue. Thanks! :blush:

4 Likes