PuzzleScript icon indicating copy to clipboard operation
PuzzleScript copied to clipboard

Node build fails with 'illegal characters in path'

Open david-pfx opened this issue 1 year ago • 4 comments

Here is the node install and command line: npm i rimraf compress-images web-resource-inliner ncp [email protected] concat ycssmin terser gzipper html-minifier-terser glob node compile.js

Here is the full error trace:

Error: Illegal characters in path.
    at pathArg (d:\MyDocs\dev\Polyomino\PSForks\(increpare)PuzzleScript\node_modules\rimraf\dist\cjs\src\path-arg.js:45:33)
    at AsyncFunction.<anonymous> (d:\MyDocs\dev\Polyomino\PSForks\(increpare)PuzzleScript\node_modules\rimraf\dist\cjs\src\index.js:57:47)
    at d:\MyDocs\dev\Polyomino\PSForks\(increpare)PuzzleScript\compile.js:53:12
    at cb (d:\MyDocs\dev\Polyomino\PSForks\(increpare)PuzzleScript\node_modules\ncp\lib\ncp.js:255:37)
    at WriteStream.<anonymous> (d:\MyDocs\dev\Polyomino\PSForks\(increpare)PuzzleScript\node_modules\ncp\lib\ncp.js:133:14)
    at Object.onceWrapper (node:events:627:28)
    at WriteStream.emit (node:events:525:35)
    at finish (node:internal/streams/writable:748:10)
    at node:internal/streams/writable:726:13
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  path: 'd:\\MyDocs\\dev\\Polyomino\\PSForks\\(increpare)PuzzleScript\\bin\\images\\*.png',
  code: 'EINVAL'
}

Debugging shows that the illegal character is the '*'. My guess is it should be globbed, but isn't. Beyond that I have no idea.

david-pfx avatar Mar 06 '23 09:03 david-pfx

This is caused by a breaking change in rimraf version 4. See: isaacs/rimraf#251. On Linux/MacOS, the glob path is a valid path so just doesn't delete any images.

Need to pin rimraf to version 3. We should commit package.json and package-lock.json to avoid these kinds of issues cropping up.

sftrabbit avatar Mar 06 '23 23:03 sftrabbit

I agree 100%. Working on it (if I ever get the sodding thing to work😣)

david-pfx avatar Mar 06 '23 23:03 david-pfx

Problem solved. I'll submit a PR.

david-pfx avatar Mar 07 '23 00:03 david-pfx

Single purpose PR submitted.

david-pfx avatar Apr 24 '23 07:04 david-pfx