increpare / PuzzleScript

Open Source HTML5 Puzzle Game Engine
MIT License
903 stars 159 forks source link

Node build fails with 'illegal characters in path' #955

Open david-pfx opened 1 year ago

david-pfx commented 1 year ago

Here is the node install and command line: npm i rimraf compress-images web-resource-inliner ncp gifsicle@5.3.0 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.

sftrabbit commented 1 year ago

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.

david-pfx commented 1 year ago

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

david-pfx commented 1 year ago

Problem solved. I'll submit a PR.

david-pfx commented 1 year ago

Single purpose PR submitted.