Skip to content

npm start failed (code: 'ERR_PACKAGE_PATH_NOT_EXPORTED') #11579

Closed

Description

@zzz6519003

➜ my-app git:(master) npm start

my-app@0.1.0 start
react-scripts start

node:internal/modules/cjs/loader:488
throw e;
^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by "exports" in /Users/zzz/Develop/my-app/node_modules/postcss-safe-parser/node_modules/postcss/package.json
at new NodeError (node:internal/errors:371:5)
at throwExportsNotFound (node:internal/modules/esm/resolve:416:9)
at packageExportsResolve (node:internal/modules/esm/resolve:669: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.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object. (/Users/zzz/Develop/my-app/node_modules/postcss-safe-parser/lib/safe-parser.js:1:17) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

Node.js v17.0.1

Activity

  1. Yochyo commented on Oct 29, 2021

    @Yochyo

    Can be temporarely fixed by downgrading to 16.13.0

  2. changed the title [-]npm start failed[/-] [+]npm start failed (code: 'ERR_PACKAGE_PATH_NOT_EXPORTED')[/+] on Oct 30, 2021
  3. AnthonyPoschen commented on Nov 6, 2021

    @AnthonyPoschen

    for anyone on mac needing the above temp fix which worked for me.
    brew install node@16

  4. Ueland commented on Nov 11, 2021

    @Ueland

    The "temp fix" is now two weeks old, any better fix out there yet?

  5. Lionprincipe commented on Nov 12, 2021

    @Lionprincipe

    hello,
    I 'am using Node.js v17.0.1 and upgrading my package helped me solved this issue without downgrading the node version.

    "yarn upgrade"

    hope this will help waiting for the fix.

  6. ptrtorain commented on Nov 13, 2021

    @ptrtorain

    cmd > npm i node@16. Now I can launch node@17. Looks like something missing in a clean node@17

  7. Ansub commented on Dec 1, 2021

    @Ansub

    "yarn upgrade"

    fixed the bug for me, and React App started working.

  8. aeskafi commented on Dec 1, 2021

    @aeskafi

    "yarn upgrade"

    fixed the bug for me, and everything works perfectly.

  9. kedbirhan commented on Dec 4, 2021

    @kedbirhan

    why is this error being thrown though, is it because of dependencies incompatibility ??

  10. Ansub commented on Dec 4, 2021

    @Ansub

    yeah, I think when we install react, it installs on the latest version, but the yarn was not updated to that version that supports the version of react. "yarn upgrade" fixed the bug because it upgrades packages to their latest version.

  11. nlintas commented on Dec 5, 2021

    @nlintas

    If you got a message saying you will no longer receive security fixes if you do not upgrade when running yarn start or npm start then the solution is to run yarn upgrade, this will update the yarn packages and resolve this issue.

  12. Bazmundi commented on Dec 5, 2021

    @Bazmundi

    Looking to learn react so, basically upgraded my nodejs and npm and went for an npx create-react-app following the destructions at: https://reactjs.org/docs/create-a-new-react-app.html

    That is:

    npx create-react-app my-app
    cd my-app
    npm start
    
    

    Running on Windows 10, Node.js v17.2.0, npm/npx comes up as 8.2.0.

    As I had not previously installed react, the npx command line above kindly pulled that in.

    So, changed directory into my-app thence npm start left the insult at: https://pastebin.com/czGkpX1K

    Lucked into this bug report. Ran yarn update thanks. Changes the insult to the following insult: https://pastebin.com/Zdchie2b

    So, steps:

    What fixed it for me was remover nodejs 17.2.0 and install 16.13.1 thanks.

  13. YousefAlsbaihi commented on Dec 14, 2021

    @YousefAlsbaihi

    yarn upgrade

    This worked for me on

    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-scripts": "4.0.3",
    
  14. zzz6519003 commented on Dec 14, 2021

    @zzz6519003
    Author

    but, need to yarn upgrade every time

  15. jhkcia commented on Dec 27, 2021

    @jhkcia

    Fixed by running npm upgrade

  16. ananshe commented on Jan 26, 2022

    @ananshe

    cmd > npm i node@16. Now I can launch node@17. Looks like something missing in a clean node@17

    Awesome! That was easy fix, THANKS TO YOU!

  17. timothymureithi commented on Sep 24, 2022

    @timothymureithi

    "start": "react-scripts --openssl-legacy-provider start",
    "build": "react-scripts --openssl-legacy-provider build"

    That worked for me

  18. xtRAVEN commented on Dec 2, 2022

    @xtRAVEN

    "start": "react-scripts --openssl-legacy-provider start",
    "build": "react-scripts --openssl-legacy-provider build"

    that worked for me x2
    thanks @timothymureithi

  19. HeyKalangi commented on Jul 15, 2023

    @HeyKalangi
  20. Achal9099 commented on Jul 29, 2024

    @Achal9099

    Error:
    npm start

    nbi-spp-ui@7.12.0-SNAPSHOT start
    npm run build:css && concurrently --kill-others 'npm:watch:css' 'react-scripts --openssl-legacy-provider start'

    nbi-spp-ui@7.12.0-SNAPSHOT build:css
    postcss src/app/shared/styles/tailwind.css -o src/app/shared/styles/main.css

    [1] ''react-scripts' is not recognized as an internal or external command,
    [1] operable program or batch file.
    [1] 'react-scripts exited with code 1
    --> Sending SIGTERM to other processes..
    [watch:css] npm run watch:css exited with code 1

    package.json content
    "scripts": {
    "start": "npm run build:css && concurrently --kill-others 'npm:watch:css' 'react-scripts --openssl-legacy-provider start'",
    "build": "npm run build:css && react-scripts --openssl-legacy-provider build",
    "build:js": "react-scripts --openssl-legacy-provider build",

    "test": "react-scripts test",
    "test:all": "react-scripts test --watchAll=false",
    "test:coverage": "react-scripts test --coverage --watchAll",
    "test:debug": "react-scripts --inspect-brk test --runInBand --no-cache",
    "eject": "react-scripts eject",
    "prettier:base": "prettier 'src/**/*.{js,jsx,ts,tsx,json,css,scss,md}'",
    "prettier:check": "yarn prettier:base --check",
    "prettier:fix": "yarn prettier:base --write",
    "l

    Can someone help?
    
  21. zzz6519003 commented on Jul 29, 2024

    @zzz6519003
    Author

    Install 'react-scripts

    I always think it’s bad to have it

  22. Achal9099 commented on Jul 29, 2024

    @Achal9099

    its install

    npm ls -g react-scripts
    C:\Program Files\nodejs -> .
    `-- react-scripts@5.0.1

    PS C:\Users\AchalBhangreNational\IdeaProjects\nbi-spport-ui> npm ls react-scripts
    nbi-spp-ui@7.12.0-SNAPSHOT C:\Users\AchalBhangreNational\IdeaProjects\nbi-spport-ui
    +-- @storybook/preset-create-react-app@2.1.2
    | -- react-scripts@4.0.1 deduped -- react-scripts@4.0.1

    node -v
    v18.20.4

    npm -v
    10.7.0
    yarn -v
    1.22.22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions