If you were directed here, you probably saw a warning or error in your console when using nps
for your npm scripts.
This happens when you either:
- Don't have a
package-scripts.yml
orpackage-scripts.js
file in your project - Specified a config with the
-c
or--config
flag and it doesn't exist
Make sure that you either have a package-scripts.yml
, package-scripts.js
file in your project or that you use the -c
/--config
flag to
point to a file that actually exists.
This happens if you specify a script name that can't be resolved to a script. See the docs/examples for how you can define scripts and how they can be referenced.
This happens when you use the --require
flag and the module you specify cannot be resolved.
- Check that you spelled the module correctly
- Check that the module you wish to require is require-able
This means that one of the scripts nps
tried to run resulted in a non-zero exit code (a failing exit code)
Try to run the script without nps
and verify that the script is working. If not, fix that. If it's working without nps
it could be a problem with nps
. Please file an issue.
This means that the child process for the specified script emitted an error.
Look at the error and try to figure out why the script would be failing.
Try to run the script without nps
and verify that the script is working. If not, fix that. If it's working without nps
it could be a problem with nps
. Please file an issue.
Your package-scripts.js
, package-scripts.yml
, or whatever you specified as the --config
must be a nopn-empty object or a function that returns a non-empty object.
Make sure that your config is an object or a function that returns an object.
This happens if you pass flags to nps
that are not valid (like nps --invalid-flag-name
). This most often happens when you're trying to forward arguments to a script like: nps build --fast
Make sure you put your scripts and the relevant arguments in quotes: nps "build --fast"