javascript - Visual Studio 中的构建后 Vue 应用程序给出“命令 npm run build exited with code 1”
问题描述
我正在 Visual Studio 中构建一个 Vue 应用程序,运行构建后,我留下了错误:The command npm run build exited with code 1
. 我注意到它发生在我的 Vue 应用程序的后期构建中,代码如下:
<Exec WorkingDirectory="$(OutDir)" Command="$(PostBuildEvent)"/>
这是我的整个后期构建脚本:
<PropertyGroup>
<PostBuildEventDependsOn></PostBuildEventDependsOn>
</PropertyGroup>
<Target
Name="PostBuildEvent"
Condition="'$(PostBuildEvent)' != '' and ('$(RunPostBuildEvent)' != 'OnOutputUpdated' or '$(_AssemblyTimestampBeforeCompile)' != '$(_AssemblyTimestampAfterCompile)')"
DependsOnTargets="$(PostBuildEventDependsOn)">
<Exec WorkingDirectory="$(OutDir)" Command="$(PostBuildEvent)"/>
我希望将一个包 javascript 文件放在我的 Vue 应用程序的“dist”文件夹中。谢谢您的帮助。
解决方案
只需以管理员身份运行 VS。
推荐阅读
- bash - 如何使用终端批量复制目录中的文件夹名称?
- arrays - 通过数组求和合并
- apache-kafka - librdkafka partition.assignment.strategy 添加新策略
- visual-studio - VS2019 自定义模板未显示
- java - 如何在 spring 和 vertx 应用程序中维护每个请求的作者姓名?
- angular - 在 iframe、Angular-8 中显示本地 HTML
- scala - 使用 zeebe 输入/输出映射发送 jsonPath
- powershell - Powershell - 如何检查特定机器中的登录用户
- javascript - window.scrollto 和 scrollIntoView 在 ios 中不能平滑滚动
- azure-active-directory - 将来宾用户添加到 Microsoft Planner