首页 > 解决方案 > nexe :术语“nexe”未被识别为 cmdlet、函数、脚本文件或可操作的名称

问题描述

当我们尝试通过 nexe 命令构建 exe 时,我们面临以下问题。这在 Oracle VM 的开发环境中运行良好,但在服务器机器上,这种情况正在发生。Nexe 模块已安装,我可以在 node_modules 文件夹中看到它。请让我知道可能缺少什么。

PS <C:\Program Files\iisnode\www\tcnx>> nexe PLM_Adaptor.js --build

nexe : The term 'nexe' is not recognized as the name of a cmdlet, function, script file, or operable 
program. Check the spelling of the name, or if a path was included, verify that the path is correct 
and try again.
At line:1 char:1
+ nexe PLM_Adaptor.js --build
+ ~~~~
    + CategoryInfo          : ObjectNotFound: (nexe:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

谢谢,帕万。

标签: node.js

解决方案


npm i nexe -g 

将在这样的路径中安装 nexe 模块:

C:\Users\your_username\AppData\Roaming\npm

它还将在此文件夹中存储一个名为“nexe.cmd”的文件。这是您在命令行中键入“nexe”时实际执行的文件。为了完成这项工作,请确保 nexe.cmd 存在于提到的 npm 文件夹中(或找到它所在的位置),并确保此文件夹位于 PATH 中,如下所示:

set PATH=%PATH%;C:\Users\your_username\AppData\Roaming\npm

推荐阅读