'sed' is not recognized as an internal or external command (Windows 10)

12,128

Did you set the HOME directory as mentioned in here, http://gnuwin32.sourceforge.net/install.html

If it doesn't fix, install http://cygwin.com/ and give a try

Share:
12,128

Related videos on Youtube

Rahul
Author by

Rahul

Updated on June 04, 2022

Comments

  • Rahul
    Rahul over 1 year

    I'm working with a JavaScript app it's running by yarn. I found issue when I run yarn run dev. It's showing below error.

    yarn run v1.21.1
    $ yarn fixlitepicker && rm -rf .cache/ dist/
    $ sed -i 's/# sourceMappingURL/ sourceMappingURL/g' node_modules/litepicker/dist/js/main.js
    'sed' is not recognized as an internal or external command,
    operable program or batch file.
    error Command failed with exit code 1.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
    error Command failed with exit code 1.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
    

    I know it's come from package.json scripts.

    "scripts": {
        "dev": "parcel src/index.html",
        "build": "yarn install && yarn fixlitepicker && parcel build src/index.html",
        "prebuild": "rm -rf dist",
        "predev": "yarn fixlitepicker && rm -rf .cache/ dist/",
        "fixlitepicker": "sed -i 's/# sourceMappingURL/ sourceMappingURL/g' node_modules/litepicker/dist/js/main.js"
      },
    

    I already download SED from here and install it. Install location C:\Program Files (x86)\GnuWin32. But it's not working. I seen same issue. I don't understand how to fix this issue.

    System

    OS: Windows 10 Pro.
    OS Version: 1909.
    OS System Type: 64-bit operating system, x64-based processor.

    enter image description here

    • tripleee
      tripleee almost 4 years
      Clearly the script was written for Unix-like platforms. Can you get rid of Windows here? (You'll thank me later.)
    • Pierre François
      Pierre François almost 4 years
      Try to run the yarn command from a GNU a shell terminal environment (v.gr. bash) rather than from a Windows command line.
    • shellter
      shellter almost 4 years
      there are 22 other Q/A's here when I search the exact text of your Subject Line. AND if if remove sed is from that search, there are 6000+ other Q/As dealing with this subject. Did you review these messages to help solve your problem? Please do and Good luck.
  • Rahul
    Rahul almost 4 years
    Thanks for your ans. Cygwin terminal work but GnuWin32 have error.