2017-12-22 10 views
0

을 실행하는 방법을 나는 nativescript - 구글 -지도 - SDK 플러그인 Nativescript는 - 플러그인 데모

를 복제하고 '데모'폴더에있는 응용 프로그램을 실행하고 싶습니다.

어떻게하면됩니까?

나는 데모 폴더에 가서 tns build iOS

가 잘 작동 입력 한 다음

tns run iOS

나는 오류

Could not find module 'nativescript-google-maps-sdk'

이 마지막에 오류가있어 :

file:///app/main-page.js:3:25: JS ERROR Error: Could not find module 'nativescript-google-maps-sdk'. Computed path '/Users/asrock/Library/Developer/CoreSimulator/Devices/2462B1E0-F0D5-4EC5-B31B-1A5AE8CACC74/data/Containers/Bundle/Application/DD86BB36-6F11-437C-B6CA-9F936478E87D/demo.app/app/tns_modules/nativescript-google-maps-sdk'.

/node_modules 대신/tns_modules에서 Google sdk를 찾는 것처럼 보입니다.

답변

0

데모 응용 프로그램에서 플러그인을 찾을 위치를 알 수없는 것 같습니다. plugin.prepare 또는 plugin.link 또는 link의 라인을 따라 무언가가 필요할 수 있습니다. prepare은 설정 방법에 따라 유용 할 수 있습니다. 맨 위에있는 tsc이 모든 전화를 npm run tsc으로 수정한다는 것을 잊지 마십시오. 또한 과 같은 실제 플러그인 이름을 <<<<YOUR-PLUGIN-NAME>>>>으로 바꾸는 것을 잊지 마십시오.

// In the official plugin seed src/package.json 
// https://github.com/NativeScript/nativescript-plugin-seed 

"scripts": { 
    "tsc": "tsc -skipLibCheck", 
    "build": "npm i && tsc", 
    "postclone": "npm i && node scripts/postclone.js && cd ../demo && npm i && cd ../src && npm run plugin.link", 
    "test.android": "npm i && npm run tsc && npm run tslint && cd ../demo && tns build android && tns test android --justlaunch", 
    "test.ios": "npm i && npm run tsc && npm run tslint && cd ../demo && tns build ios && tns test ios --justlaunch", 
    "tslint": "cd .. && tslint \"**/*.ts\" --config tslint.json --exclude \"**/node_modules/**\"", 
    "plugin.link": "npm link && cd ../demo && npm link <<<<YOUR-PLUGIN-NAME>>>> && cd ../src", 
    "plugin.tscwatch": "npm run tsc -- -w", 
    "demo.ios": "npm i && npm run tsc && cd ../demo && tns run ios --syncAllFiles", 
    "demo.android": "npm i && npm run tsc && cd ../demo && tns run android --syncAllFiles", 
    "demo.reset": "cd ../demo && rimraf platforms", 
    "plugin.prepare": "npm run tsc && cd ../demo && tns plugin remove <<<<YOUR-PLUGIN-NAME>>>> && tns plugin add ../src", 
    "clean": "cd ../demo && rimraf hooks node_modules platforms && cd ../src && rimraf node_modules && npm run plugin.link", 
    "ci.tslint": "npm i && tslint '**/*.ts' --config '../tslint.json' --exclude '**/node_modules/**'" 
}, 
+0

여전히 nativescript-google-maps-sdk의 데모 폴더를 실행하려고합니다. 데모 폴더에 CD를 넣고 iOS를 실행하는 tns를 실행하면 응용 프로그램을 만들고 시뮬레이터에 보내지 만 시작시 충돌이 발생합니다. 내 OP와 같은 오류가 발생합니다. – dashman

+0

더 빨리 보지 못해서 사과드립니다 ... 데모를 실행하고 동일한 결과를 얻으 려합니다. – Jarvis

+0

빌드 할 수 없었습니다. -/그래서 너에게 무엇을 말해야할지 모르겠다. 그것은 모든 파일을 복사하지 않는 것 ... 당신이'tns ios --syncAllFiles'를 실행 해 보았습니다. 뭔가를 건너 뛰고 있는지 보았습니까? – Jarvis