I am using Visual Studio 2015 and creating a test MVC application.
I have added bower file (bower.json) with code as follows:
{
"name": "asp.net",
"private": true,
"dependencies": {
"jquery": "2.2.3",
"jquery-validation":"1.15.1",
"jquery-validation-unobtrusive": "3.2.5"
},
"resolutions": {
"jquery-validation": ">=1.8"
}
}
When I save the bower.json, it downloads all correctly, but for jquery-validation it does not download the dist folder:
Related
I am trying to create an angular 2 app
Below is the typescript code
import { Component } from 'angular2/core';
#Component({
selector: 'my-app',
template: ' < h1 > My First SharePoint Add In using Angular2... !!! < /h1>'
})
export class AppComponent { }
It is throwing the below errors
cannot find module angular2/core
Experimental support for decorators is a feature that is subject to change in a future release
For the second error I have also added
"experimentalDecorators": true,
in the tsconfig.json
I have also installed TypeScript SDK for Visual Studio 2017 and restarted Visual studio, but no luck
I also tried npm install -g typescript#latest
Below is my package.json
{
"name": "imageslideshow",
"version": "1.0.0",
"description": "slide show for image libraries",
"main": "index.js",
"dependencies": {
"#angular/core": "^4.3.2",
"angular2": "^2.0.0-beta.17",
"es6-promise": "^4.1.1",
"es6-shim": "^0.35.3",
"reflect-metadata": "^0.1.2",
"rxjs": "^5.0.0-beta.6",
"systemjs": "^0.20.17",
"zone.js": "^0.8.16"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "vignesh",
"license": "ISC"
}
When I try npm install I get the below message
Make sure you have run npm install on your project and the
dependencies are available in the node_modules folder.
In your package.json file you have dependencies with both Angular
version 2 and 4. Decide which one you want to use.
If you want to use Angular version 4 your import should be:
import { Component } from '#angular/core';
I am following this documentation https://www.microsoft.com/net/core#macos on how to run .NET Core on mac. I have successfully installed the dotnet command and all but when I try to create a new project using dotnet new, it generates a .csproj file as opposed to project.json as described. This doesn't allow me to go on to run dotnet restore or dotnet run to run this new project. I don't know what I'm missing out here. Kindly assist.
I found a way around this. I created a project.json file and put the necessary parameters in it. In this case,
{
"version": "1.0.0-*",
"buildOptions": {
"debugType": "portable",
"emitEntryPoint": true
},
"dependencies": {},
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
},
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0"
},
"imports": "dnxcore50"
}
}
}
Then dotnet restore works there on.
Cheers!
I have developed an extension for Visual Studio Code.
Its working fine on my computer.
"devDependencies": {
"fs": "^0.0.2",
"github": "^0.2.4",
"node-github": "0.0.3",
"open": "^0.0.5",
"typescript": "^1.6.2",
"vscode": "0.10.x"
},
"dependencies": {
"fs": "^0.0.2",
"github": "^0.2.4",
"node-github": "0.0.3",
"open": "^0.0.5",
"typescript": "^1.6.2",
"vscode": "0.10.x"
}
The problem is when I publish the extension online and download it. I don't get those npm modules in my computer causing my extension to crash.
How can I add those modules while publish?. If there is no possibility then how do I read a file and post it on github without npm modules in a visual studio code extension.
I would suggest looking at some of the extensions in the gallery https://marketplace.visualstudio.com/#VSCode. Specifically, the "Get Started" on the right usually points to a GitHub repo where you look at how other people have solved this issue.
I didn't use any dependencies like that in my extension, but here's the first one that looked similar to what you want: https://github.com/ziyasal/vscode-open-in-github/blob/master/package.json
I had to change it to.
"devDependencies": {
"typescript": "^1.6.2",
"vscode": "0.10.x"
},
"dependencies": {
"fs": "^0.0.2",
"github": "^0.2.4",
"node-github": "0.0.3",
"open": "^0.0.5"
}
then run npm install and then vsce package then it will added into that extension file.
I can't get react-art in bower.json in Visual Studio 2015. However, I can get it in package.json.
Package.json:
As a result, I don't see React-art in the wwwroot\lib folder and the react-art not working.
{
"name": "ASP.NET",
"version": "0.0.0",
"devDependencies": {
"gulp": "3.8.11",
"gulp-concat": "2.5.2",
"gulp-cssmin": "0.1.7",
"gulp-uglify": "1.2.0",
"rimraf": "2.2.8",
"react": "0.13.3",
"react-art": "0.13.0"
}
}
bower.json
The reason you've got it package.json is because you've installed a npm package of react-art, not a bower one (which isn't available). But if you're using Browserify, you'll be to use it with the following command
var reactArt = require('react-art');
I am trying to compile scss file using the grunt-contrib-sass plugin (with grunt v0.4.0). The compiled result is an empty css file. Below are the base.scss, Gruntfile.js and package.json files.
base.scss
$color: #000;
header{
color: $color;
}
Gruntfile.js
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
// Metadata.
pkg: grunt.file.readJSON('package.json'),
sass: {
dist: {
options: { style: "expanded", trace: true },
files: { "base.css": "base.scss" }
}
}
});
grunt.loadNpmTasks('grunt-contrib-sass');
// Default task.
grunt.registerTask("default", [""]);
grunt.registerTask("sass--",["sass"]);
};
package.json
{
"name": "my_grunt",
"version": "1.0.0",
"description": "New to Grunt",
"main": "index.js",
"scripts": {
"test": "test"
},
"repository": {
"type": "git",
"url": "none"
},
"keywords": [
"none"
],
"author": "none",
"license": "BSD",
"devDependencies": {
"grunt-contrib-sass": "~0.2.2"
}
}
Result:
Either I run the sass command "grunt sass" or "grunt sass--", the result is just an empty css file without any errors.
Your help is greatly appreciated
Niusaul
If you haven't installed Grunt globally, you'll either do that or add Grunt as a dependency. Otherwise Grunt won't work.
To install Grunt globally run npm install -g grunt-cli in your Terminal or add as a "devDependency":
"devDependencies": {
"grunt": "0.4.x",
"grunt-contrib-sass": "0.7.x",
}
Edit:
While searching on Google about this problem, I stumpled upon a reported bug on Github from the same user where his problem is solved. Just for everyone who may experienced the same problem, this was his solution:
The error is caused by the manual config that I've set in the Command
Processor (Windows registry), from which I've added an autorun to
change the default command prompt.