简体   繁体   English

ionic平台添加android导致如下错误

[英]ionic platform add android results in the following error

I am trying to add Android platform to the Ionic 2 project but getting below issue.我正在尝试将 Android 平台添加到 Ionic 2 项目,但遇到以下问题。

Error: Cannot find module 'internal/util/types'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at evalmachine.<anonymous>:44:31
at Object.<anonymous> (C:\Users\User\AppData\Roaming\npm\node_modules\cordova\node_modules\npm\node_modules\graceful-fs\fs.js:11:8)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)

Below are my ionic 2 project information:以下是我的 ionic 2 项目信息:

   Cordova CLI: 4.2.0
   Ionic Framework Version: 2.0.0-beta.11
   Ionic CLI Version: 2.2.3
   Ionic App Lib Version: 2.2.1
   ios-deploy version: Not installed
   ios-sim version: Not installed
   OS: Windows 8.1
   Node Version: v10.15.2
   Xcode version: Not installed
   npm version: 6.9.0

Any idea?任何的想法? what i am missing我错过了什么

What caused the problem for me was that I upgraded node and needed to rebuild my project.对我造成问题的原因是我升级了节点并需要重建我的项目。

npm rebuild

Fixed it for me.为我修好了。

Try uninstalling and installing NodeJS again.再次尝试卸载并安装 NodeJS。 That might help you to resolve this issue.这可能会帮助您解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM