Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ERR_PACKAGE_PATH_NOT_EXPORTED] -> Add package subpath #338

Closed
levizimmerman opened this issue Jul 15, 2022 · 2 comments · Fixed by #339
Closed

[ERR_PACKAGE_PATH_NOT_EXPORTED] -> Add package subpath #338

levizimmerman opened this issue Jul 15, 2022 · 2 comments · Fixed by #339

Comments

@levizimmerman
Copy link

When I run yarn ios with a React Native project where concurrently package as devDependency I get the following error:

error Failed to load configuration of your project.
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './package.json' is not defined by "exports" in /Users/my-name/Repos/project-name/node_modules/concurrently/package.json
    at new NodeError (node:internal/errors:372:5)
    at throwExportsNotFound (node:internal/modules/esm/resolve:472:9)
    at packageExportsResolve (node:internal/modules/esm/resolve:753:3)
    at resolveExports (node:internal/modules/cjs/loader:482:36)
    at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
    at Function.resolve (node:internal/modules/cjs/helpers:108:19)
    at resolveNodeModuleDir (/Users/my-name/Repos/project-name/node_modules/@react-native-community/cli-tools/build/resolveNodeModuleDir.js:24:42)
    at /Users/my-name/Repos/project-name/node_modules/@react-native-community/cli-config/build/loadConfig.js:93:76
    at Array.reduce (<anonymous>)

Environment:

  • React Native 0.69.1
  • NPM version 8.14.0
  • Node version 16.16.0
  • MacOS Monterey 12.1
  • Concurrently version 7.2.2

I can fix this to change the following in the package.json:

{
  "name": "concurrently",
  "version": "7.2.2",
  "description": "Run commands concurrently",
  "main": "index.js",
  "types": "dist/src/index.d.ts",
  "type": "commonjs",
  "bin": {
    "concurrently": "./dist/bin/concurrently.js"
  },
  "engines": {
    "node": "^12.20.0 || ^14.13.0 || >=16.0.0"
  },
  "exports": {
+    ".": {
      "import": "./index.mjs",
      "require": "./index.js",
      "default": "./index.js",
      "types": "./dist/src/index.d.ts"
+    },
+    "./package.json": "./package.json"
  },
  "scripts": {
    "build": "tsc --build",
    "postbuild": "chmod +x dist/bin/concurrently.js",
    "clean": "tsc --build --clean",
    "lint": "eslint . --ext js,ts --ignore-path .gitignore",
    "prepublishOnly": "npm run build",
    "report-coverage": "cat coverage/lcov.info | coveralls",
    "test": "jest"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/open-cli-tools/concurrently.git"
  },
  "keywords": [
    "bash",
    "concurrent",
    "parallel",
    "concurrently",
    "command",
    "sh"
  ],
  "author": "Kimmo Brunfeldt",
  "license": "MIT",
  "dependencies": {
    "chalk": "^4.1.0",
    "date-fns": "^2.16.1",
    "lodash": "^4.17.21",
    "rxjs": "^7.0.0",
    "shell-quote": "^1.7.3",
    "spawn-command": "^0.0.2-1",
    "supports-color": "^8.1.0",
    "tree-kill": "^1.2.2",
    "yargs": "^17.3.1"
  },
  "devDependencies": {
    "@types/jest": "^27.0.3",
    "@types/lodash": "^4.14.178",
    "@types/node": "^17.0.0",
    "@types/shell-quote": "^1.7.1",
    "@types/supports-color": "^8.1.1",
    "@types/yargs": "^17.0.8",
    "@typescript-eslint/eslint-plugin": "^5.8.1",
    "@typescript-eslint/parser": "^5.8.1",
    "coveralls-next": "^4.1.2",
    "eslint": "^8.15.0",
    "jest": "^27.5.1",
    "jest-create-mock-instance": "^2.0.0",
    "ts-jest": "^27.1.4",
    "ts-node": "^10.4.0",
    "typescript": "^4.5.4"
  },
  "files": [
    "dist",
    "index.js",
    "index.mjs",
    "!**/fixtures",
    "!**/*.spec.js",
    "!**/*.spec.d.ts"
  ],
  "jest": {
    "preset": "ts-jest",
    "collectCoverage": true,
    "collectCoverageFrom": [
      "src/**/*.ts",
      "!src/index.ts"
    ],
    "coveragePathIgnorePatterns": [
      "/fixtures/",
      "/node_modules/"
    ],
    "testEnvironment": "node",
    "testPathIgnorePatterns": [
      "/node_modules/",
      "/dist"
    ]
  }
}

Could you resolve this?

@gustavohenke
Copy link
Member

#339

@gustavohenke
Copy link
Member

It's published as v7.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants