![](/img/trans.png)
[英]MongoDB Cannot find module '/booksSchema' on Mac Catalina
[英]cannot find module 'pouchdb', works on mac, but not on windows
我正在接管一個在我的隊友Mac上運行的離子項目。 使用ionic / cordova / python清潔Windows 10 PC。 該項目運行,但是發生以下錯誤。 我嘗試了多種不同的方式將pouchdb包含在項目中(使用@ types /使用較舊的版本,使用require而不是導入,刪除和重新安裝節點模塊等),但找不到此錯誤的任何方法。 我已還原所做的所有更改。 以下代碼適用於我的隊友mac。
我也只是和他核對過版本。 我正在運行所有相同版本的node / python / ionic等。
的package.json
{
"name": "camara2",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"@angular/common": "5.0.0",
"@angular/compiler": "5.0.0",
"@angular/compiler-cli": "5.0.0",
"@angular/core": "5.0.0",
"@angular/forms": "5.0.0",
"@angular/http": "5.0.0",
"@angular/platform-browser": "5.0.0",
"@angular/platform-browser-dynamic": "5.0.0",
"@ionic-native/camera": "^4.11.0",
"@ionic-native/core": "4.3.2",
"@ionic-native/splash-screen": "4.3.2",
"@ionic-native/status-bar": "4.3.2",
"@ionic/storage": "2.1.3",
"@types/pouchdb": "6.3.2",
"ajv": "^6.0.0",
"cordova-android": "^6.2.3",
"cordova-browser": "^4.1.0",
"cordova-ios": "^4.4.0",
"cordova-plugin-camera": "^2.4.1",
"cordova-plugin-compat": "^1.2.0",
"cordova-plugin-console": "^1.1.0",
"cordova-plugin-device": "^1.1.7",
"cordova-plugin-splashscreen": "^4.1.0",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-whitelist": "^1.3.3",
"cropperjs": "^1.4.1",
"ionic": "^4.6.0",
"ionic-angular": "3.9.2",
"ionic-plugin-keyboard": "^2.2.1",
"ionicons": "3.0.0",
"json-circular-stringify": "0.0.1",
"mrz": "^3.1.0",
"newtondev-mrz-parser": "^1.1.0",
"rxjs": "5.5.2",
"sw-toolbox": "3.6.0",
"tesseract.js": "^1.0.10",
"zone.js": "0.8.18"
},
"devDependencies": {
"@ionic/app-scripts": "3.2.1",
"@ionic/lab": "1.0.6",
"typescript": "2.4.2"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-whitelist": {},
"ionic-plugin-keyboard": {},
"cordova-plugin-camera": {},
"cordova-plugin-console": {}
},
"platforms": [
"android",
"browser",
"ios"
]
}
}
進口
//import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Http, Headers, HttpModule } from '@angular/http';
import PouchDB from 'pouchdb';
import 'rxjs/add/operator/map';
您必須使用安裝PouchDB
npm install --save pouchdb
@types/pouchdb
不是實際的模塊。 這只是打字稿的類型,您需要兩個模塊。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.