I am developing a NPM that has a command(script) that I want to use, but I cannot use it unless I add the scripts to the project's package.json file. I want to avoid this method and use a command to run the script (I don't mind adding more packages).
custom-npm package.json
"scripts":{
"custom-script": "node-sass --watch scss -o dist/css"
}
How can I run that script with a command (like: npm run custom-script
)? Do I need to have global dependencies to run the script?
edit:
I tried using npx
but I would get these messages:
user@username project % npx custom-script
npx: installed 1 in 1.204s
Unexpected token import
user@username project % npx custom-npm custom-script
npx: installed 1 in 1.196s
Unexpected token import
Not sure what the Unexpected token import
is all about