Skip to content

Commit a9d14ce

Browse files
committed
fix: fix npm #204
1 parent 1badab5 commit a9d14ce

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

src/legacy/main/NodeJsHelper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ int executeNpmCommand(std::string cmd, std::string workingDir) {
373373
MaybeLocal<v8::Value> loadenv_ret = node::LoadEnvironment(env, executeJs.c_str());
374374
if (loadenv_ret.IsEmpty()) // There has been a JS exception.
375375
throw "error";
376-
exit_code = node::SpinEventLoop(env).FromMaybe(1);
376+
exit_code = node::SpinEventLoop(env).FromMaybe(0);
377377
} catch (...) {
378378
lse::LegacyScriptEngine::getInstance().getSelf().getLogger().error(
379379
"Fail to execute NPM command. Error occurs"

src/lse/PluginManager.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,11 @@ ll::Expected<> PluginManager::load(ll::mod::Manifest manifest) {
117117
)
118118
);
119119
if ((exitCode = NodeJsHelper::executeNpmCommand("npm install", ll::string_utils::u8str2str(dirPath.u8string())))
120-
== 0)
121-
lse::LegacyScriptEngine::getInstance().getSelf().getLogger().info(""_tr());
122-
else
120+
!= 0) {
123121
lse::LegacyScriptEngine::getInstance().getSelf().getLogger().error(
124122
"Error occurred. Exit code: {code}"_tr(fmt::arg("code", exitCode))
125123
);
124+
}
126125
}
127126
#endif
128127
if (hasMod(manifest.name)) {

tooth.nodejs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"github.com/LiteLDev/LegacyParticleAPI": "0.9.x",
1717
"github.com/LiteLDev/LegacyMoney": "0.9.x",
1818
"gitea.litebds.com/ShrBox/7-zip": "24.x",
19-
"gitea.litebds.com/LiteLDev/node-binaries": "22.12.0-rc.1"
19+
"gitea.litebds.com/LiteLDev/node-binaries": "22.12.0-rc.2"
2020
},
2121
"prerequisites": {
2222
"github.com/LiteLDev/LeviLamina": "1.0.x"

0 commit comments

Comments
 (0)