2

So i'm really new to this type of stuff. When running my 'npm start' command, it keeps dropping the following error below:

[ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/rest/RequestHandler' is not defined by "exports" in /root/InviteManagerV2/node_modules/eris/package.json

I've looked up the error many times and 'deleting all the files and reinstalling' didn't work, neither did a update. Do you guys have any idea on how i can fix this? Any help would be great!

Here is my startup script:

    "scripts": {
        "start": "cross-env NODE_ENV=dev node scripts/dev-run.js",
        "debug": "cross-env NODE_ENV=dev node scripts/dev-run.js debug",
        "build": "tsc",
        "lint": "tslint --project tsconfig.json --config tslint.json --format stylish",
        "format": "prettier --write \"src/**/*.ts\" \"docs/**/*.md\" \"README.md\" \"CHANGELOG.md\"",
        "release": "npm run build && npm run docs && npm run format && standard-version",
        "i18n": "node scripts/check-i18n.js",
        "nxv": "node ./scripts/npm-exact-versions.js",
        "docs": "node scripts/generate-docs.js"
    },
Firework
  • 219
  • 2
  • 15

1 Answers1

0

Use this

  1. install a npm package env-cmd [package documentation][1]

    npm install env-cmd

  2. make a folder in root directory of project, name it as config and create a file in it called as dev.env

  3. Define your environment variables in this dev.env for eg PORT=3000

  4. then add this line to your package.json file

    "start ": "env-cmd -f ./config/dev.env node scripts/dev-run.js"

Jatin Mehrotra
  • 9,286
  • 4
  • 28
  • 67
  • Tried both of those, sadly i still have the same error – Firework Sep 18 '20 at 08:15
  • Updated my answer, this works :) its a clean approach and helps you to define various environment variable depending on your use case for eg for development seperate env file and for production different env variables – Jatin Mehrotra Sep 18 '20 at 08:27