format and test scripts generate SyntaxErrors
See original GitHub issueSeems reproducible with any new noderize app create, even after successful build/watch, initially running…
yarn format
generates a SyntaxError via @noderize\scripts\node_modules\.bin\prettier
and args handling?
yarn test
generates a SyntaxError via @noderize\scripts\node_modules\.bin\jest
and args handling?
λ yarn format
yarn run v1.5.1
$ noderize-scripts format
[INFO] Formatting...
c:\projects\typescript\first-noderize\node_modules\@noderize\scripts\node_modules\.bin\prettier:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
^^^^^^^
SyntaxError: missing ) after argument list
at new Script (vm.js:51:7)
at createScript (vm.js:136:10)
at Object.runInThisContext (vm.js:197:10)
at Module._compile (module.js:613:28)
at Object.Module._extensions..js (module.js:660:10)
at Module.load (module.js:561:32)
at tryModuleLoad (module.js:501:12)
at Function.Module._load (module.js:493:3)
at Function.Module.runMain (module.js:690:10)
at startup (bootstrap_node.js:194:16)
[WARN] Done formatting!
Done in 1.67s.
λ yarn test
yarn run v1.5.1
$ noderize-scripts test
[INFO] Testing...
The system cannot find the path specified.
c:\projects\typescript\first-noderize\node_modules\@noderize\scripts\node_modules\.bin\jest:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
^^^^^^^
SyntaxError: missing ) after argument list
at new Script (vm.js:51:7)
at createScript (vm.js:136:10)
at Object.runInThisContext (vm.js:197:10)
at Module._compile (module.js:613:28)
at Object.Module._extensions..js (module.js:660:10)
at Module.load (module.js:561:32)
at tryModuleLoad (module.js:501:12)
at Function.Module._load (module.js:493:3)
at Function.Module.runMain (module.js:690:10)
at startup (bootstrap_node.js:194:16)
Done in 1.75s.
Issue Analytics
- State:
- Created 6 years ago
- Comments:23 (23 by maintainers)
Top Results From Across the Web
Understand and Resolve Syntax Errors in a Template or Script
When HotDocs encounters a component or instruction in a template or script that it doesn't recognize or understand, it generates and displays a...
Read more >Syntax Error - an overview | ScienceDirect Topics
Syntax errors are mistakes in the source code, such as misspelling of an instruction mnemonic or failure to declare a label before using...
Read more >Syntax Errors in Coding and What You Can Do to Fix Them
A syntax error commonly occurs in coding when the coder has typed in something incorrectly. Syntax errors are easy to find and fix....
Read more >Script syntax error checking
All script fields provide controls for checking the syntax for errors and for locating the error easily when one occurs.
Read more >Common SQL syntax errors and how to resolve them
In this article, we are going to describe some of the most common SQL syntax errors, and explains how you can resolve these...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The core issue seems to come down to
npm
assuming the command passed to it is a JS file–somewhere in the complicated script calling script decomposition into commands and args at work here–this is however not true on Windows wherenpm
wraps bin files in a.cmd
file.Since
npm
can not parse.cmd
files–where our SyntaxError: issue is coming from–you need to reference the bin file manually in the package.json scripts section as part of a script.And in order to use this cross platform (i.e. Linux, Mac and Windows), you need to change the path from the form:
to the full location and adding the .js file extension:
At least that’s my current understanding of the issue.
@cretezy Thanks. Havent had as much time for anything past work, but with
prepack
working, Im looking at a couple new things I ran across for the cross platform issues. I get anywhere with it, Ill let you know.