Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 运行时错误:找不到模块;“离子天然”;_Node.js_Ionic Framework_Ionic2_Backand - Fatal编程技术网

Node.js 运行时错误:找不到模块;“离子天然”;

Node.js 运行时错误:找不到模块;“离子天然”;,node.js,ionic-framework,ionic2,backand,Node.js,Ionic Framework,Ionic2,Backand,我正在尝试将ionic 2应用程序连接到backand,并出现以下运行时错误: 找不到模块“离子本机” 我试过运行npm install@ionic native/core--save——但没有帮助。非常感谢 设置详细信息如下:Ionic框架:3.0.1 Ionic应用程序脚本: 1.3.0 Angular Core:4.0.0 Angular编译器CLI:4.0.0节点:6.10.1操作系统平台:Windows 10导航器平台:Win32用户代理:Mozilla/5.0 (Windows NT

我正在尝试将ionic 2应用程序连接到backand,并出现以下运行时错误:

找不到模块“离子本机”

我试过运行
npm install@ionic native/core--save
——但没有帮助。非常感谢

设置详细信息如下:Ionic框架:3.0.1 Ionic应用程序脚本: 1.3.0 Angular Core:4.0.0 Angular编译器CLI:4.0.0节点:6.10.1操作系统平台:Windows 10导航器平台:Win32用户代理:Mozilla/5.0 (Windows NT 10.0;Win64;x64)AppleWebKit/537.36(KHTML,如Gecko) Chrome/57.0.2987.133 Safari/537.36

错误:在g处找不到模块“ionic native” (localhost:8100/build/polyfills.js:3:7133)位于Object.module.exports (localhost:8100/build/main.js:114616:7)在网页上 (localhost:8100/build/main.js:20:30)at对象。 (localhost:8100/build/main.js:86362:73)在网页上 (localhost:8100/build/main.js:20:30)at对象。 (localhost:8100/build/main.js:140153:70)在网页上 (localhost:8100/build/main.js:20:30)在 localhost:8100/build/main.js:66:18

Package.Json
如下:

{
  "name": "ionic-hello-world",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve"
  },
  "dependencies": {
    "@angular/common": "4.0.0",
    "@angular/compiler": "4.0.0",
    "@angular/compiler-cli": "4.0.0",
    "@angular/core": "4.0.0",
    "@angular/forms": "4.0.0",
    "@angular/http": "4.0.0",
    "@angular/platform-browser": "4.0.0",
    "@angular/platform-browser-dynamic": "4.0.0",
    "@ionic-native/core": "3.4.2",
    "@ionic-native/splash-screen": "3.4.2",
    "@ionic-native/status-bar": "3.4.2",
    "@ionic/storage": "2.0.1",
    "ionic-angular": "3.0.1",
    "ionicons": "3.0.0",
    "rxjs": "5.1.1",
    "socket.io-client": "^1.7.3",
    "sw-toolbox": "3.4.0",
    "zone.js": "^0.8.4"
  },
  "devDependencies": {
    "@ionic/app-scripts": "1.3.0",
    "@types/node": "7.0.13",
    "@types/socket.io-client": "1.4.29",
    "typescript": "~2.2.1"
  },
  "cordovaPlugins": [
    "cordova-plugin-whitelist",
    "cordova-plugin-statusbar",
    "cordova-plugin-console",
    "cordova-plugin-device",
    "cordova-plugin-splashscreen",
    "ionic-plugin-keyboard",
    "cordova-plugin-inappbrowser"
  ],
  "cordovaPlatforms": [],
  "description": "myApp: An Ionic project"
}

使用Ionic 3,Ionic本机模块现在作为提供程序加载。请参阅以下链接:


因此,如果要使用任何本机功能,必须升级代码。

此问题与旧的导入“ionic native”相关

就我而言: 从“离子本机”导入{StatusBar,Splashscreen}; 我删除并添加了新的:


如果这也是您的情况,请不要忘记在模块提供程序中也添加内容

我不确定您需要看到什么,但任何帮助都值得欣赏。您可以显示您的
package.json
文件吗?永远不要把你的问题放在评论部分。请删除它,并把它和你原来的帖子放在一起。嗨,它不会让我把所有的问题都粘贴到原来的评论中,因为它显然有链接。使用stackoverflow是一种全新的方法。如何获取package.json文件?我意识到这是一个新手问题可能这是示例
package.json
文件?那么,你的目标是什么?谢谢Sampath,我已经把它添加到问题中了谢谢,那么我需要升级到ionic 3吗?我想我使用的是2.2.1A版,现在看起来你已经在v3上了。确保您已遵循链接中提到的升级说明。