0

I am on the latest version of node (18.7.0), all I am doing is trying to install a test Sitecore jss app. But the first step itself is giving me this error. Is there any version compatibility I should be aware of here? enter image description here

Here's the log extract

21 verbose title npm install @sitecore-jss/sitecore-jss-cli
22 verbose argv "install" "--global" "@sitecore-jss/sitecore-jss-cli"
23 timing npm:load:setTitle Completed in 1ms
24 timing config:load:flatten Completed in 3ms
25 timing npm:load:display Completed in 4ms
26 verbose logfile logs-max:10 dir:C:\Users\acean\AppData\Local\npm-cache\_logs
27 verbose logfile C:\Users\acean\AppData\Local\npm-cache\_logs\2022-08-08T14_42_57_575Z-debug-0.log
28 timing npm:load:logFile Completed in 10ms
29 timing npm:load:timers Completed in 0ms
30 timing npm:load:configScope Completed in 0ms
31 timing npm:load Completed in 30ms
32 verbose stack C:\Users\acean\AppData\Roaming\nvm\v18.7.0\node_modules\npm\node_modules\libnpmfund:1
32 verbose stack ../workspaces/libnpmfund
32 verbose stack ^
32 verbose stack
32 verbose stack SyntaxError: Unexpected token '.'
32 verbose stack     at Object.compileFunction (node:vm:360:18)
32 verbose stack     at wrapSafe (node:internal/modules/cjs/loader:1049:15)
32 verbose stack     at Module._compile (node:internal/modules/cjs/loader:1084:27)
32 verbose stack     at Module._extensions..js (node:internal/modules/cjs/loader:1174:10)
32 verbose stack     at Module.load (node:internal/modules/cjs/loader:998:32)
32 verbose stack     at Module._load (node:internal/modules/cjs/loader:839:12)
32 verbose stack     at Module.require (node:internal/modules/cjs/loader:1022:19)
32 verbose stack     at require (node:internal/modules/cjs/helpers:102:18)
32 verbose stack     at Object.<anonymous> (C:\Users\acean\AppData\Roaming\nvm\v18.7.0\node_modules\npm\lib\utils\reify-output.js:16:38)
32 verbose stack     at Module._compile (node:internal/modules/cjs/loader:1120:14)
33 verbose cwd C:\WINDOWS\system32
34 verbose Windows_NT 10.0.22000
35 verbose node v18.7.0
36 verbose npm  v8.15.0
37 error Unexpected token '.'
38 verbose exit 1
39 timing npm Completed in 159ms
40 verbose code 1
41 error A complete log of this run can be found in:
41 error     C:\Users\acean\AppData\Local\npm-cache\_logs\2022-08-08T14_42_57_575Z-debug-0.log

I went back to an older version of node (16.13.0) and Sitecore jss CLI (19.0.0), but here I am unable to create a new jss app using:

jss create test-app nextjs

I am seeing the error

'Server sent 404 Not Found while enumerating templates.':

enter image description here

Please help in resolving this!

4
  • We need error messages and so on, included as text. Always. Never images. Aug 8, 2022 at 10:51
  • @MarkCassidy I've added the log file text & the error message I see in text alongside version details.
    – Durga Bose
    Aug 8, 2022 at 14:49
  • @DurgaBose Did you try this command before creating JSS? npm i @sitecore-jss/sitecore-jss-cli@<version> Aug 8, 2022 at 15:08
  • @SumitBhatia Yes I installed v19.0.0 of sitecore-jss-cli. Please see the 2nd screenshot above. Thanks.
    – Durga Bose
    Aug 8, 2022 at 18:02

3 Answers 3

1

I did the same with this configuration that you are using.

enter image description here

Then I run the following command and see the output.

npm install -g @sitecore-jss/sitecore-jss-cli@19.0.0

enter image description here

Then I run the same command that you used and got the same error.

jss create test-app nextjs

enter image description here

Finally I solved it by running the following command. And it worked for me.

npx create-sitecore-jss nextjs

See the output

enter image description here

0

As already mentioned you need to run npx create-sitecore-jss nextjs.

This is a new feature that was added to Sitecore JSS 20.0.0: https://github.com/Sitecore/jss/releases/tag/v20.0.0

New Features & Improvements [create-sitecore-jss]

  • New package containing initializers / templates for JSS sample applications (#881), (#883), (#882), (#880), (#879), (#878), (#876)
  • This replaces previous jss create method to create new JSS applications
  • You can now create an application with guided prompts using initializer command of choice (npx create-sitecore-jss, npm init sitecore-jss, yarn create sitecore-jss) 🎉🎉🎉

So that is why jss create test-app nextjs works when trying to use Sitecore JSS 19.0.0. It doesn't work anymore with Sitecore JSS 20.0.0.

0

I had to downgrade from node LTS (16.17.0) to 16.13.2 to get rid of that particular error.

Also install @sitecore-jss/sitecore-jss-cli globally first (with version 20.0.3) or better yet specify the version to install within the app directory npm i @sitecore-jss/sitecore-jss-cli@<version>.

If you create the app locally without this version, it would default to a lower version and mess up some file generation, such as the file [[..path]].tsx:

enter image description here

The npx command for 20+ should be:

npx create-sitecore-jss

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.