jessety / pm2-installer

Install PM2 offline as a service on Windows or Linux. Mostly designed for Windows.
MIT License
494 stars 50 forks source link

Unrecognized token in source text - setup script #82

Open wolasss opened 1 year ago

wolasss commented 1 year ago

Description

There seems to be an error thrown by the console while running a setup script on Windows 7 Embedded.

Unrecognized token in source text.
At line:1 char:37
+ node src/tools/dependencies/echo.js  <<<< @jess
    + CategoryInfo          : ParserError: (:) []
    + FullyQualifiedErrorId : UnrecognizedToken

Solution

Apparently this line is causing an error:

$pm2_logrotate_package = "$(node src/tools/dependencies/echo.js @jessety/pm2-logrotate)"

which can be fixed by surrounding a package name with ':

$pm2_logrotate_package = "$(node src/tools/dependencies/echo.js '@jessety/pm2-logrotate')"

After this fix it works, however I didn't check on other environments so it's best to verify on different windows versions if adding quotes changes anything :) Please mind that the quotes need to be added in multiple files (ex. setup-packages, setup-logrotate)

Steps to Reproduce

  1. npm run serup

Environment

Running on: 5/4/2023, pm2-installer 3.4.3 with node v12.22.12 and npm 6.14.16 on win32-6.1.7601.

PS C:\Windows\system32> $PSVersionTab

Name                           Value
----                           -----
CLRVersion                     2.0.50
BuildVersion                   6.1.76
PSVersion                      2.0
WSManStackVersion              2.0
PSCompatibleVersions           {1.0,
SerializationVersion           1.1.0.
PSRemotingProtocolVersion      2.1