I'm new to the whole Node.js world but this probably simple problem is driving me nuts. It's basically a simplified version of a problem I'm having with a bigger project.
File structure
package.json
test1
My package.json looks like so:
{
"name": "Temp",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"testscript": "test1",
"testrun":"yarn testscript"
}
}
test1 just contains a simple console.log('test') command.
Now when I do yarn testrun I get the following error:
PS C:\dev\temp> yarn testrun
yarn run v1.9.4
$ yarn testscript
$ test1
'test1' is not recognized as an internal or external command,
operable program or batch file.
error Command failed with exit code 1.
If the file has an extension (i.e. test1.js), then it recognises it and works.
Before anyone says add the file extension, well this is just the simplest use case I've created. There's a much bigger project with this sort of thing in it and seems to work ok for all my Linux and Mac friends.