Skip to content

Commit

Permalink
fix: fix npm #204
Browse files Browse the repository at this point in the history
  • Loading branch information
ShrBox committed Jan 29, 2025
1 parent 1badab5 commit a9d14ce
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/legacy/main/NodeJsHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ int executeNpmCommand(std::string cmd, std::string workingDir) {
MaybeLocal<v8::Value> loadenv_ret = node::LoadEnvironment(env, executeJs.c_str());
if (loadenv_ret.IsEmpty()) // There has been a JS exception.
throw "error";
exit_code = node::SpinEventLoop(env).FromMaybe(1);
exit_code = node::SpinEventLoop(env).FromMaybe(0);
} catch (...) {
lse::LegacyScriptEngine::getInstance().getSelf().getLogger().error(
"Fail to execute NPM command. Error occurs"
Expand Down
5 changes: 2 additions & 3 deletions src/lse/PluginManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,11 @@ ll::Expected<> PluginManager::load(ll::mod::Manifest manifest) {
)
);
if ((exitCode = NodeJsHelper::executeNpmCommand("npm install", ll::string_utils::u8str2str(dirPath.u8string())))
== 0)
lse::LegacyScriptEngine::getInstance().getSelf().getLogger().info(""_tr());
else
!= 0) {
lse::LegacyScriptEngine::getInstance().getSelf().getLogger().error(
"Error occurred. Exit code: {code}"_tr(fmt::arg("code", exitCode))
);
}
}
#endif
if (hasMod(manifest.name)) {
Expand Down
2 changes: 1 addition & 1 deletion tooth.nodejs.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"github.com/LiteLDev/LegacyParticleAPI": "0.9.x",
"github.com/LiteLDev/LegacyMoney": "0.9.x",
"gitea.litebds.com/ShrBox/7-zip": "24.x",
"gitea.litebds.com/LiteLDev/node-binaries": "22.12.0-rc.1"
"gitea.litebds.com/LiteLDev/node-binaries": "22.12.0-rc.2"
},
"prerequisites": {
"github.com/LiteLDev/LeviLamina": "1.0.x"
Expand Down

0 comments on commit a9d14ce

Please sign in to comment.