You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Visual Studio 2015 Cordova新项目构建失败求助

Hey Chris, let's work through this Cordova build problem you're hitting. The error in your log—missing vs-tac/app.js—is tied to a compatibility clash between your brand-new Node.js version and the older vs-tac tooling that Visual Studio uses for Cordova projects. You've already tried clearing the Cordova cache and reinstalling global packages, so let's try these targeted fixes:

1. Downgrade Node.js to a compatible version

New Node.js releases often break support for legacy tooling like vs-tac@1.0.42 (the version your VS is trying to use). Stick to Node.js 14.x or 12.x—these LTS versions are proven to work smoothly with the Visual Studio Apache Cordova tools from that era.

  • Uninstall your current Node.js via Control Panel > Programs and Features.
  • Grab an installer for Node.js 14.x LTS from the official Node.js archives.
  • After installing, restart Visual Studio fully and try building your project again.

2. Manually install the required vs-tac version

Visual Studio's auto-install of vs-tac might have failed to populate your project's node_modules folder correctly. Let's fix this manually:

  • Delete the node_modules folder in your BlankCordovaApp2 project directory.
  • Open a command prompt in your project's root folder, then run this command:
    npm install vs-tac@1.0.42
    
  • Back in Visual Studio, go to Tools > Options > Tools for Apache Cordova > Cordova Tools and click Clear Cordova Cache.
  • Rebuild your project.

3. Double-check Visual Studio's Node.js path configuration

After upgrading or downgrading Node.js, VS might still be pointing to an old or incorrect executable path:

  • Open Tools > Options > Tools for Apache Cordova > Environment Variables.
  • Verify that the NODE_PATH variable points to your current Node.js installation directory (e.g., C:\Program Files\nodejs). Update it if it's wrong.
  • Restart VS and test the build again.

4. Reinstall the Apache Cordova Tools extension

Corruption in the VS extension can cause issues with how vs-tac is installed and referenced:

  • Open Visual Studio, go to Tools > Extensions and Updates.
  • Search for "Apache Cordova Tools", select it, and click Uninstall.
  • Restart VS, then go back to Extensions and Updates to reinstall the extension.
  • Create a fresh blank Cordova project and try building it to see if the issue is resolved.

内容的提问来源于stack exchange,提问作者Chris

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 03:52:42