So I'm trying to build the javascriptair/site. Inside the package.json
There is an npm script that points at a javascript "command" package-scripts
. That repository is found https://github.com/kentcdodds/p-s. In Windows it errors out with a JScript error.
Script: C:[path_to_code]\package-scripts.js
Line: 2
Char: 1
Error: Syntax error
Code: 800A03EA
Source: Microsoft JScript compilation error
So in the package.json
, what it has is this
"scripts": {
"start": "package-scripts"
}
If I change the package.json
to the following:
"scripts": {
"start": "package-scripts.cmd"
}
I can get the server to start. So my question is, why is this happening, and how can we change the package.json
to make it cross platform with the same command.
The reason and a workaround are pointed here: https://github.com/javascriptair/site/issues/98#issuecomment-404420108
So the problem is there is a js file in the root of repo with the same base name as binary. And npm on windows first tries to run it as binary instead of looking into './node_modules/.bin' So to workaround an issue just remove
.JS
fromPATHEXT
environment variable and restart
I've got the same problem: when there is tslint.js
file in the root dir of the package and an npm script in package.json
just calls tslint
, jscript is fired by npm instead of node, resulting in "Microsoft JScript compilation error" popup. Removing .js
from PATHEXT
helps.
This is a Node.js module that is meant to be require
d by another script. It is not designed to be executed by Microsoft JScript and if you try running the script file by itself in Node it will not do anything. This is because all of the internal methods of this particular script are supposed to be externally exposed before use.
Upon further examination it seems that the actual file you are probably looking for is in the bin folder. Run that with the node command and see what happens.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With