Tag: aurelia cli

在Visual Studio 2015社区的Aurelia捆绑

我在package.json设置了一个postinstall规则,如下所示: "postinstall": "aurelia bundle –force" 如果我从项目文件夹中的cmd运行npm install ,则不显示任何错误,但在Visual Studio 2015社区中加载项目时,它会在“输出”窗口中显示以下错误(但会输出捆绑文件): —> (Inner Exception #0) Microsoft.NodejsTools.Npm.PackageJsonException: Error reading package.json at '…\node_modules\aurelia-cli\node_modules\npm\node_modules\graceful-fs\package.json': Error reading package.json. The file may be parseable JSON but may contain objects with duplicate properties. The following error occurred: Can not add Newtonsoft.Json.Linq.JValue to Newtonsoft.Json.Linq.JObject. —> Microsoft.NodejsTools.Npm.PackageJsonException: Error reading package.json. The file may be […]

在使用Typescript的Aurelia中使用Jquery

我使用Aurelia与打字稿,使用aurelia-cli和npm作为构build系统和客户端包pipe理器。 我的目标是在我的一个.ts文件中使用jquery,所以我添加了jquery npm install jquery@2.2.4 –save 之后用于types我使用: typings install dt~jquery –global –save 我还configuration了“jquery”作为供应商捆绑依赖的aurelia.json文件。 使用: import * as jq from 'jquery'; 但该项目未能build立以下错误: Starting 'readProjectConfiguration'… Finished 'readProjectConfiguration' Starting 'processMarkup'… Starting 'processCSS'… Starting 'configureEnvironment'… Finished 'processCSS' Finished 'processMarkup' Finished 'configureEnvironment' Starting 'buildTypeScript'… typings/globals/jquery/index.d.ts(3218,13): error TS2403: Subsequent variable declarations must have the same type. Variable '$' must be of […]