Weird Error when setting up my first projetct

Hi guys,

I am getting weird errors when following the quick start guide. On my PC I’m getting this:

npx: installed 125 in 3.515s
✔ Ensuring /home/k/Projects/my-app directory.
✔ Creating package.json.
✔ Creating frontity.settings.js.
✖ Cloning @frontity/mars-theme.

Error: Command failed: npm pack @frontity/mars-theme


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

and on my laptop I can set up the project but get

Error: Unexpected token export.

when running npx frontify dev, so clearly I am doing something very wrong. Any suggestions on what the problem might be?

I run elementary OS 5.0 Juno on my PC and Kubuntu 18.04 on my Laptop, both have npm 6.4.1 and node 10.15.3.

That’s weird.

@orballo could you please take a look?

Ok, I found the bug.

Sorry about that @Konstantin. It’s our fault.

I’ve made a PR with the fix. Once is accepted we’ll release a new version :slight_smile:

Thanks for the swift fix folks, appreciate it!

1 Like

Could you please update to frontity@0.2.14?

npm install frontity@latest

Let me know if that solves the problem.

Hey, it does so on my laptop, everything works great there now. :slight_smile:

On my PC however, since the error occurs before the project is finished setting up, the problem persists:

$ npx frontity create my-app && cd my-app
npx: installed 125 in 3.588s
✔ Ensuring /home/k/Projects/my-app directory.
✔ Creating package.json.
✔ Creating frontity.settings.js.
✖ Cloning @frontity/mars-theme.

Error: Command failed: npm pack @frontity/mars-theme


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

Thank you for working on this!

Maybe this helps to locate the bug: Running the command manually seems to work just fine.

$ npm pack @frontity/mars-theme
npm notice 
npm notice 📦  @frontity/mars-theme@0.4.0
npm notice === Tarball Contents === 
npm notice 616B   package.json                          
npm notice 3.6kB  CHANGELOG.md                          
npm notice 664B   index.ts                              
npm notice 11.3kB LICENSE                               
npm notice 29B    src/html/client.ts                    
npm notice 827B   src/html/components/featured-media.js 
npm notice 817B   src/html/components/header.js         
npm notice 621B   src/html/components/link.js           
npm notice 178B   src/html/components/list/index.js     
npm notice 1.3kB  src/html/components/list/list-item.js 
npm notice 1.1kB  src/html/components/list/list.js      
npm notice 998B   src/html/components/list/pagination.js
npm notice 1.0kB  src/html/components/nav.js            
npm notice 665B   src/html/components/page404.js        
npm notice 2.4kB  src/html/components/post.js           
npm notice 1.3kB  src/html/components/theme.js          
npm notice 489B   src/html/index.js                     
npm notice 29B    src/html/server.ts                    
npm notice === Tarball Details === 
npm notice name:          @frontity/mars-theme                    
npm notice version:       0.4.0                                   
npm notice filename:      frontity-mars-theme-0.4.0.tgz           
npm notice package size:  9.0 kB                                  
npm notice unpacked size: 28.0 kB                                 
npm notice shasum:        d17f85e19c2e892970a1e2329ab2a860a6252ddb
npm notice integrity:     sha512-AyzeBj04U6g3z[...]umRW5sro0C0/Q==
npm notice total files:   18                                      
npm notice 
frontity-mars-theme-0.4.0.tgz

I’ll take a look @Konstantin. Thanks for the report.

EDIT: I’ve opened an issue https://github.com/frontity/frontity/issues/99

Hi,
I am also getting same error. Node js version: v16.17.0, npm: 8.15.0. I have installed latest frontity version as well. Please help me out
? Pick a starter theme to clone: @frontity/mars-theme (recommended)
:heavy_check_mark: Creating README.md.
:heavy_check_mark: Creating package.json.
:heavy_check_mark: Creating frontity.settings.js.
:heavy_multiplication_x: Cloning @frontity/mars-theme.

Error: Command failed: npm pack @frontity/mars-theme
node:internal/modules/cjs/loader:959
throw err;
^

Error: Cannot find module ‘D:\nodejs docs\node_examples\node_modules\npm\bin\npm-cli.js’
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
at Function.Module._load (node:internal/modules/cjs/loader:804:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47 {
code: ‘MODULE_NOT_FOUND’,
requireStack: []
}

Hi
Have you tried cloning the mars theme from github and then npm install ? Might not help but maybe a way to get it working

Clear the nodes folder and run the command npm install