You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Even though it isn't recommended to run ApostropheCMS on Windows, I've found a small bug which is worth opening a PR for.
To Reproduce
Step by step instructions to reproduce the behavior:
Running ApostropheCMS 2 branch release-2.222.0 on Windows
npm i installs packages fine on Node 14,16 and 18
npm start is throwing an error with an invalid regular expression
Expected behavior
Apostrophe should start as expected
Describe the bug
Getting the following error when starting Apostrophe on a Windows environment:
kiichiro-toyoda-cms\node_modules\apostrophe\index.js:58
throw err;
^
SyntaxError: Invalid regular expression: /\node_modules\mocha\/: \ at end of pattern
at new RegExp (<anonymous>)
at getRoot (C:\Users\user\WebStormProjects\kiichiro-toyoda-cms\node_modules\apostrophe\index.js:259:35)
at module.exports (C:\Users\user\WebStormProjects\kiichiro-toyoda-cms\node_modules\apostrophe\index.js:35:33)
at Object.<anonymous> (C:\Users\user\WebStormProjects\kiichiro-toyoda-cms\app.js:334:35)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
at internal/main/run_main_module.js:17:47
[nodemon] app crashed - waiting for file changes before starting...
A small update is required to a specific line within the root index.js file of the apostrophe release-2.222.0 branch, the following on line 259 should be updated from:
if (m.parent.filename.match(new RegExp(`${path.sep}node_modules${path.sep}mocha${path.sep}`))) {
to:
if (m.parent.filename.match(new RegExp(`${path.sep}node_modules${path.sep}mocha\${path.sep}`))) {
Details
Windows uses
Version of Node.js:
Tested on Node 14, 16 and 18
Server Operating System:
Microsoft Windows
Additional context:
This is specific to Microsoft Windows, after forking at testing the above fix Apostrophe starts as expected including on both Linux and Mac.
The text was updated successfully, but these errors were encountered:
Makes sense to submit a PR, please do. But the right way to avoid this would be to use self.apos.utils.regExpQuote so that you don't wind up with an unnecessary escape character for non-Windows path characters.
Even though it isn't recommended to run ApostropheCMS on Windows, I've found a small bug which is worth opening a PR for.
To Reproduce
Step by step instructions to reproduce the behavior:
npm i
installs packages fine on Node 14,16 and 18npm start
is throwing an error with an invalid regular expressionExpected behavior
Apostrophe should start as expected
Describe the bug
Getting the following error when starting Apostrophe on a Windows environment:
A small update is required to a specific line within the root
index.js
file of the apostrophe release-2.222.0 branch, the following on line 259 should be updated from:to:
Details
Windows uses
Version of Node.js:
Tested on Node 14, 16 and 18
Server Operating System:
Microsoft Windows
Additional context:
This is specific to Microsoft Windows, after forking at testing the above fix Apostrophe starts as expected including on both Linux and Mac.
The text was updated successfully, but these errors were encountered: