Android 找不到模块';shelljs&x27;在构建Ionic应用程序时

Android 找不到模块';shelljs&x27;在构建Ionic应用程序时,android,node.js,cordova,ionic-framework,ionic,Android,Node.js,Cordova,Ionic Framework,Ionic,当我构建android平台时,我收到一个错误,即未找到shelljs模块,但该模块已全局安装 事实上,android平台已经建成,我可以从android Studio运行该项目,但是。。。我希望能够从控制台进行模拟,但我不能这样做,因为这是一个错误 MacBook-Pro-de-Ruben-5:TransportMe rubdottocom$ sudo ionic build android Running command: /Users/rubdottocom/Documents/Androi

当我构建android平台时,我收到一个错误,即未找到shelljs模块,但该模块已全局安装

事实上,android平台已经建成,我可以从android Studio运行该项目,但是。。。我希望能够从控制台进行模拟,但我不能这样做,因为这是一个错误

MacBook-Pro-de-Ruben-5:TransportMe rubdottocom$ sudo ionic build android
Running command: /Users/rubdottocom/Documents/AndroidStudio/TransportMe/hooks/after_prepare/010_add_platform_class.js /Users/rubdottocom/Documents/AndroidStudio/TransportMe
add to body class: platform-android
Running command: /Users/rubdottocom/Documents/AndroidStudio/TransportMe/platforms/android/cordova/build
module.js:338
    throw err;
          ^
Error: Cannot find module 'shelljs'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/rubdottocom/Documents/AndroidStudio/TransportMe/platforms/android/cordova/lib/build.js:24:15)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
ERROR building one of the platforms: Error: /Users/rubdottocom/Documents/AndroidStudio/TransportMe/platforms/android/cordova/build: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: /Users/rubdottocom/Documents/AndroidStudio/TransportMe/platforms/android/cordova/build: Command failed with exit code 1
    at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:134:23)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1015:16)
    at Process.ChildProcess._handle.onexit (child_process.js:1087:5)

最后我解决了这个问题,从零开始删除并添加了平台android

由于某种原因,代码被破坏或缺少一些引用,我不知道


注意不要丢失一些重要的代码或文件,因为这样做会重新生成所有内容:p

能否在本地dev文件夹中安装shelljs模块并重试。我的意思是没有-g选项
MacBook-Pro-de-Ruben-5:TransportMe rubdottocom$ npm -g ls --depth=0
/usr/local/lib
├── bower@1.4.1
├── chromeos-apk@3.0.0
├── coffee-script@1.6.3
├── cordova@5.1.1
├── gulp@3.9.0
├── ionic@1.6.4
├── less@1.3.1
├── lungo@0.1.5
├── mocha@1.7.0
├── n@2.0.1
├── npm@2.11.3
├── phonegap@5.1.1
├── shelljs@0.5.1
└── volo@0.2.10