发布到Azure的问题:“-module”为“ none”时无法使用导入

时间:2019-06-10 08:19:20

标签: typescript azure vue.js publish

我正在基于以下模板进行.NET和Vue项目:https://github.com/danijelh/aspnetcore-vue-typescript-template

虽然在将项目发布到本地文件时没有问题,但是在发布到Azure VM时出现错误:

Severity    Code    Description Project File    Line    Suppression State
Error   TS1148  (TS) Cannot use imports, exports, or module augmentations when '--module' is 'none'.    Miscellaneous   ~\iceandfire\App.vue    36  Active
Error   TS1219  (TS) Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning.    Miscellaneous   ~\iceandfire\App.vue    45  Active
Error   TS2307  (TS) Cannot find module 'vue-property-decorator'.   Miscellaneous   ~\iceandfire\App.vue    36  Active
Error   TS2307  (TS) Cannot find module 'vue-notification'. Miscellaneous   ~\iceandfire\App.vue    38  Active

代码是

<script lang="ts">
import { Vue, Component } from 'vue-property-decorator'

import Notifications from 'vue-notification'

Vue.use(Notifications)

@Component({
    name: 'App'
})
export default class App extends Vue { }
</script>

我猜最奇怪的是,错误仅在发布到Azure时发生,而在发布到本地文件夹/文件时一切都很好。当我将发布的文件复制到我的Azure VM时,一切运行良好。

希望能帮助您解决此问题。谢谢。

1 个答案:

答案 0 :(得分:0)

我使用了相同的模板并开始了一个新项目。 遵循以下步骤并进行了部署。它对我有用。

已安装模板:

dotnet new -i AspNetCore.Vue.TypeScript.Template

项目创建:

dotnet新vuetypescript --name Demo.Web

npm run build:prod

然后我部署了它。请尝试创建新项目并尝试部署。