- 1 year ago
Running npm script on windows starting with a period
Comment
1 / 1
In Windows, if you want to run an npm script that starts with a period (e.g., npm run .myscript
), you can use the following command:
bashnpm run ".myscript"
The double quotes ("
) are used to escape the period and prevent Windows from interpreting it as a special character. This allows you to run npm scripts that start with a period successfully on Windows.
For example, if you have a script named .myscript
defined in your package.json
file like this:
json{
"scripts": {
".myscript": "echo Running my script"
}
}
You can run it using the above command:
bashnpm run ".myscript"
This will execute the script and print the message "Running my script" in the console.