node.js 找不到模块“shelljs”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32041656/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 19:15:07  来源:igfitidea点击:

Could not find module 'shelljs'

node.jscordova

提问by Mirrh

I have an Error when I run an Apache Cordova project from Visual Studio 2015 as below.

当我从 Visual Studio 2015 运行 Apache Cordova 项目时出现错误,如下所示。

Error   BLD401  Error : BLD00401 : Could not find module 'shelljs'. Please Go to Tools --> Options --> Tools for Apache Cordova --> Cordova Tools --> Clear Cordova Cache and try building again.

I tried to install shelljs grobally

我尝试全局安装 shelljs

npm install -g shelljs

npm install -g shelljs

But still not working.

但仍然无法正常工作。

Should I convert it to PhoneGap project and work on other IDEs?

我应该将其转换为 PhoneGap 项目并在其他 IDE 上工作吗?

回答by Mirrh

I found the solution that some reason the [-g] to install globally wasn't working. So what I did was installing the shelljs command in the project location as below.

我发现由于某种原因全局安装的 [-g] 不起作用的解决方案。所以我所做的是在项目位置安装 shelljs 命令,如下所示。

Path To The Project\platforms\android\cordova

项目路径\platforms\android\cordova

and then install "shelljs" at the location

然后在该位置安装“shelljs”

npm install shelljs

npm 安装 shelljs

Hope this help someone has the same issue.

希望这有助于有人有同样的问题。