2

To create a Sitecore JSS app, I ran the PowerShell command below :

npx create-sitecore-jss --templates nextjs,nextjs-sxa --appName foodorder --hostName sc103.sc  --fetchWith GraphQL

However, I encountered the following error:

TypeError: Class extends value undefined is not a constructor or null
    at Object.<anonymous> (C:\Users\bn803\AppData\Roaming\nvm\v12.15.0\node_modules\npm\node_modules\socks-proxy-agent\dist\index.js:110:44)
    at Module._compile (node:internal/modules/cjs/loader:1254:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Module._load (node:internal/modules/cjs/loader:958:12)
    at Module.require (node:internal/modules/cjs/loader:1141:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at Object.<anonymous> (C:\Users\bn803\AppData\Roaming\nvm\v12.15.0\node_modules\npm\node_modules\make-fetch-happen\lib\agent.js:174:29)
    at Module._compile (node:internal/modules/cjs/loader:1254:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Module._load (node:internal/modules/cjs/loader:958:12)
    at Module.require (node:internal/modules/cjs/loader:1141:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at Object.<anonymous> (C:\Users\bn803\AppData\Roaming\nvm\v12.15.0\node_modules\npm\node_modules\make-fetch-happen\lib\remote.js:7:18)
    at Module._compile (node:internal/modules/cjs/loader:1254:14)

I ran the command shown below, but it did not work.

npm install socks-proxy-agent@latest

What can I do to resolve this error?

1 Answer 1

3

I suspect nvm version 12.15.0. I tried your command with node version 18.12.1 with my local and it worked for me. I would recommend trying the latest node version and following the steps below.

  1. Install or switch to the latest node version. (nvm install 18.12.1 or nvm use 18.12.1)
  2. Install or use the latest JSS CLI globally (npm install -g @sitecore-jss/sitecore-jss-cli)
  3. Open PowerShell in administrator mode and run command (npx create-sitecore-jss --templates nextjs,nextjs-sxa --appName foodorder --hostName sc103.sc --fetchWith GraphQL)

Configuration details that worked for me:

enter image description here

Hope it helps!

1
  • 1
    Hi Sumit, I just wanted to say a quick thank you for your answer to my question Your solution worked perfectly for me and I really appreciate the time and effort you took to help me out. Apr 4, 2023 at 3:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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