nexe:术语“ nexe”不能识别为cmdlet,函数,脚本文件或可操作文件的名称

时间:2019-11-04 08:15:08

标签: node.js

当我们尝试通过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

谢谢, 帕万。

2 个答案:

答案 0 :(得分:0)

npm i nexe -g 

将在以下路径中安装nexe模块:

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

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

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

答案 1 :(得分:0)

npm i nexe -g 

运行此命令,问题将得到解决...