我当前正在使用Visual Studio 2017,我安装了ionic 2扩展程序以构建应用程序的UI。当我尝试在浏览器上运行该应用程序时,会显示以下消息:
您快要准备好了!如果看到此页面,则仍需要为Visual Studio安装NPM Task Runner扩展并再次运行此应用。您可以从以下网址下载扩展程序:https://aka.ms/ctmhio要了解有关配置Visual Studio 2015以使用Ionic 2模板的更多信息,请访问https://aka.ms/c4915c。
我已经安装了npm任务运行程序扩展,所以我不明白为什么无法识别它。
这是我的任务运行浏览器的内容:
C:\Users\benit\source\repos\ionic2-ts-blank2\ionic2-ts-blank2> cmd.exe /c npm run ionic:build --color=always
> io.cordova.myapp2cc051@ ionic:build C:\Users\benit\source\repos\ionic2-ts-blank2\ionic2-ts-blank2
npm WARN lifecycle The node binary used for scripts is C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\NodeJs\win-x64\node.exe but npm is using C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\NodeJs\node.exe itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
> ionic-app-scripts build
internal/modules/cjs/loader.js:583
throw err;
^
Error: Cannot find module 'C:\Users\benit\source\repos\ionic2-ts-blank2\ionic2-ts-blank2\node_modules\@ionic\app-scripts\bin\ionic-app-scripts.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
at startup (internal/bootstrap/node.js:236:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:560:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! io.cordova.myapp2cc051@ ionic:build: `ionic-app-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the io.cordova.myapp2cc051@ ionic:build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\benit\AppData\Roaming\npm-cache\_logs\2019-03-07T16_55_13_034Z-debug.log
Process terminated with code 1.
------------