【发布时间】:2018-10-03 07:27:52
【问题描述】:
我在使用 vue-cli-template 将 nativescript 模块安装到 nativescript-vue 时遇到问题。正如on official website 提到的,我应该通过 npm 安装,然后清理构建。所以我安装了模块:
npm i --save nativescript-audio
npm run clean
然后尝试先用“require”实现:
const audio = require('nativescript-audio');
const player = new audio.TNSPlayer();
然后用“导入”:
import { TNSPlayer } from "nativescript-audio";
但我经常遇到同样的错误:
Error: com.tns.NativeScriptException: Failed to find module: "nativescript-audio\options", relative to: app/tns_modules/
完整的日志是here
在 Windows 7 和 Ubuntu 16.04 上试用
这是模块中的问题还是我实现错误?
【问题讨论】:
标签: npm vue.js nativescript vue-cli