skip to Main Content

I have a nextjs project which to test locally i need to run on on https, i have seen there is a –experimental-https command but when i run it i am getting

Unknown or unexpected option: --experimental-https

my project is "next": "14.2.3"

even when i create a new app i still get the warning, infact i also get a warning

The `app` directory is experimental. To enable, add `appDir: true` to your `next.config.js` configuration under `experimental`. See https://nextjs.org/docs/messages/experimental-app-dir-config

and i have to add a next.config.js with

/** @type {import('next').NextConfig} */
const nextConfig = {
    experimental: {
      appDir: true,
    }
  }
   
  module.exports = nextConfig

I have tried updating next js but feel i must be doing something wrong.

Any suggestions would be appriciated.

2

Answers


  1. Chosen as BEST ANSWER

    I had to remove all traces of node.js and then re install it (even thought i already had the latest version installed)


  2. for run Next.js server locally on HTTPS you should run this script on terminal:

    next dev --experimental-https

    or change package.json file scripts like this:

    "dev": "next dev --experimental-https"} and after that in terminal you can run npm run dev

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search