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

'.' is not recognized as an internal command when trying to run npm run prebuild #49

Open
ncesar opened this issue Apr 16, 2021 · 3 comments

Comments

@ncesar
Copy link

ncesar commented Apr 16, 2021

I have installed the react-clear-cache package and in the docs it says that I need to add a new script to my package.json.

This is my package.json scripts:

  "scripts": {
    "start": "node scripts/start.js",
    "build": "node scripts/build.js",
    "prebuild": "npm run generate-build-meta",
    "generate-build-meta": "./node_modules/react-clear-cache/bin/cli.js"
  },

According to the docs I need to run npm run generate-build-meta but everytime I try, node tells me that it wasnt able to find "./node_modules/react-clear-cache/bin/cli.js"

What I should do to correctly run this cli.js?

By the way, I have the react-clear-cache in my node_modules and I can see the cli.js

This is the message I receive:
enter image description here

It is pretty much saying that '.' is not recognized as an internal command.

@LucienZuber
Copy link

I ran into a similar issue (I am using Windows 10) and I managed to solve it by calling the cli.js file using
"prebuild": "node node_modules/react-clear-cache/bin/cli.js"

I also merged prebuild and generate-build-meta into one single script as both were doing the same in my case (I think the purpose of having two scripts is in case you want to add extra steps to the pre-build one).

Now once I run npm run prebuild it will generate a meta.json file into the public folder containing the current version.

@abdullahmehboob20s
Copy link

same error

@noorshanu
Copy link

how to resolve this error while npm run build in react vite

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

No branches or pull requests

4 participants