npm install that loads dependency with package.json as authored - json

I noticed that when viewing a package.json under node_modules, I see JSON that looks like:
{
"_args": [
[
"example#0.2.0",
"C:\\path\\to\\project\\folder"
]
],
"_from": "example#0.2.0",
"_id": "example#0.2.0",
"_inCache": true,
"_installable": true,
"_location": "/example",
"_nodeVersion": "6.2.0",
"_npmUser": {},
"_npmVersion": "3.8.9",
"_phantomChildren": {},
"_requested": {
"name": "example",
"raw": "example#0.2.0",
"rawSpec": "0.2.0",
"scope": "#edf",
"spec": "0.2.0",
"type": "version"
},
"_requiredBy": [
"/"
],
"_resolved": "http://internal.registry/example/-/example-0.2.0.tgz",
"_shasum": "b564b263db925ff3a8bffdc922c16f8e4b6f4641",
"_shrinkwrap": null,
"_spec": "example#0.2.0",
"_where": "C:\\path\\to\\project\\folder",
"author": {
"name": "NPM User"
},
"dependencies": {
"gulp": "^3.9.1",
"gulp-concat": "^2.6.0",
"gulp-less": "^3.1.0"
},
"description": "Example Package",
"devDependencies": {},
"dist": {
"shasum": "b564b263db925ff3a8bffdc922c16f8e4b6f4641",
"tarball": "http://internal.registry/example/-/example-0.2.0.tgz"
},
"main": "index.js",
"name": "example",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"readmeFilename": "README.md",
"scripts": {
"postinstall": "gulp"
},
"version": "0.2.0"
}
Instead of just:
{
"name": "example",
"version": "0.2.0",
"description": "Example Package",
"main": "index.js",
"scripts": {
"postinstall": "gulp"
},
"author": "NPM User",
"dependencies": {
"gulp": "^3.9.1",
"gulp-concat": "^2.6.0",
"gulp-less": "^3.1.0"
}
}
Is there a command-line argument I can specify to keep dependency package.json files as authored when installing, or is there another way I can access the file as authored when there is no repository specified for the package?
I found an option called proprietary-attribs on the npm-config documentation but I don't think that's what I'm looking for.

Related

The term 'Add-Migration' is not recognized as the name of a cmdlet, function, script file, or operable program

Please help me fix this issue. Below is my project.json file.
{
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0",
"type": "platform"
},
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview2-final",
"type": "build"
},
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
"Microsoft.AspNetCore.Mvc": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.EntityFrameworkCore": "1.0.0",
"Microsoft.EntityFrameworkCore.SqlServer": "1.0.0",
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final",
"Microsoft.EntityFrameworkCore.SqlServer.Design": "1.0.0"
},
"tools": {
"Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final",
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.0.0-preview2-final",
"imports": [ "portable-net45+win8+dnxcore50", "portable-net45+win8" ]
}
},
"frameworks": {
"netcoreapp1.0": {
"imports": [ "dotnet5.6", "portable-net45+win8" ]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"publishOptions": {
"include": [ "wwwroot", "web.config" ]
},
"scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
When I create a brand new project, and add the same project.json file to the project, "Add-Migration" command works perfect.
As I check on the internet, people talk about Restarting VS2015 , I have done it all and still the issue exists.
Have you tried running the Enable-Migrations command before your Add-Migration?
Or if that doesn't work, this answer seems to suggest reinstalling Entity Framework from Nuget

How to include extension on my package.json file

I want to include this extension ol3-layerswitcher on my package.json file
My package.json:
{
"name": "TEST",
"version": "1.0.0",
"description": "OpenLayers 3",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "beefy app.js:bundle.js --live",
"compile:dev": "./node_modules/.bin/browserify app.js -o bundle.js",
"compile:prod": "./node_modules/.bin/browserify app.js | uglifyjs > bundle.js"
},
"author": "test",
"license": "MIT",
"dependencies": {
"jquery": "^3.1.0",
"jquery-ui": "^1.12.0",
"openlayers": "^3.17.1",
"ol3-layerswitcher": "^1.0.2"
},
"devDependencies": {
"browserify": "^13.0.0",
"uglify-js": "^2.7.0",
"beefy": "^2.1.8"
}
}
add this line :
"dependencies": {
"jquery": "^3.1.0",
"jquery-ui": "^1.12.0",
"ol3-layerswitcher": "git://github.com/walkermatt/ol3-layerswitcher.git",
"openlayers": "^3.17.1"
}

Razor intellisense for #model not working in ASP.NET Core 1.0

I'm following this tutorial from ASP.NET site and when I try to add #model MovieGenreViewModel at the top of the Index.chtml view the intellisense shows up and show MovieGenreViewModel as shown in the picture below. But when I click[or double click] on it, the VS editor only shows the first two letters that I manually type. It does not type (print) the entire word MovieGenreViewModel. I'm using latest release of ASP.NET Core 1.0 and VS2015-Update3
_ViewImports.cshtml
#using MvcMovie
#using MvcMovie.Models
#using MvcMovie.Models.AccountViewModels
#using MvcMovie.Models.ManageViewModels
#using Microsoft.AspNetCore.Identity
#addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
project.json
{
"userSecretsId": "aspnet-MvcMovie-be3df79b-3899-4d3b-b5f4-69b744e8d2f2",
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0",
"type": "platform"
},
"Microsoft.AspNetCore.Authentication.Cookies": "1.0.0",
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
"Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0",
"Microsoft.AspNetCore.Mvc": "1.0.0",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview2-final",
"type": "build"
},
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
"Microsoft.EntityFrameworkCore.SqlServer": "1.0.0",
"Microsoft.EntityFrameworkCore.SqlServer.Design": {
"version": "1.0.0",
"type": "build"
},
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.0.0-preview2-final",
"type": "build"
},
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Configuration.UserSecrets": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0",
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
"version": "1.0.0-preview2-final",
"type": "build"
},
"Microsoft.VisualStudio.Web.CodeGenerators.Mvc": {
"version": "1.0.0-preview2-final",
"type": "build"
}
},
"tools": {
"BundlerMinifier.Core": "2.0.238",
"Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final",
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final",
"Microsoft.Extensions.SecretManager.Tools": "1.0.0-preview2-final",
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
"version": "1.0.0-preview2-final",
"imports": [
"portable-net45+win8"
]
}
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"publishOptions": {
"include": [
"wwwroot",
"Views",
"Areas/**/Views",
"appsettings.json",
"web.config"
]
},
"scripts": {
"prepublish": [ "bower install", "dotnet bundle" ],
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}

Gulp-notify compile error

I am using gulpfile.js but it is throwing compile time error for gulp-notify
Following is structure of package.json
{
"name": "flux-pricing",
"version": "0.0.1",
"description": "Pricing component with flux",
"main": "gulpfile.js",
"dependencies": {
"flux": "^2.0.0",
"react": "^0.12.0",
"underscore": "^1.7.0"
},
"devDependencies": {
"envify": "~1.2.1",
"browserify": "~4.2.0",
"gulp": "~3.9.0",
"gulp-notify": "~1.4.0",
"gulp-util": "~2.2.19",
"reactify": "~0.13.1",
"vinyl-source-stream": "~0.1.1",
"watchify": "~0.10.2"
},
"scripts": {
"start": "watchify -o js/bundle.js -v -d .",
"build": "browserify . | uglifyjs -cm > js/bundle.min.js"
},
"author": "Ken Wheeler",
"browserify": {
"transform": [
"reactify",
"envify"
]
}
}

Bug in bower-installer, can't find bower.json

Tired of bower downloading everything in each repo I install, I setup bower-installer.
https://scotch.io/tutorials/only-grab-the-files-you-need-while-using-bower
However after running bower-installer I get this strange error:
bower-installer
/usr/local/lib/node_modules/bower-installer/bower-installer.js:56
throw createError('Neither bower.json nor component.json present', 'ENOEN
My bower.json file is there, and what's in it below:
{
"name": "app",
"main": "app.js",
"version": "0.0.0",
"authors": [
"Leon"
],
"description": "My app",
"keywords": [
"tags",
"manage"
],
"license": "MIT",
"homepage": "me.com",
"private": true,
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"angular-bootstrap": "~0.12.1",
"angular-loader": "1.2.x",
"angular-mocks": "~1.2.x",
"angular-route": "1.2.x",
"angular-scroll": "~0.6.5",
"chartist": "~0.7.3",
"bootstrap": "~3.3.4",
"angular": "~1.3.15"
},
"install": {
"path": "libs",
"sources": {
"angular": "bower_components/angular/angular.min.js",
"bootstrap": "bower_components/bootstrap/dist/js/bootstrap.min.js",
"chartist": [
"bower_components/chartist/dist/chartist.min.js",
"bower_components/chartist/dist/chartist.min.css",
],
"angular-scroll": "bower_components/angular-scroll/angular-scroll.min.js",
"angular-route": "bower_components/angular-route/angular-route.min.js",
"angular-mocks": "bower_components/angular-mocks/angular-mocks.js",
"angular-loader": "bower_components/angular-loader/angular-loader.min.js",
"angular-bootstrap": [
"bower_components/angular-bootstrap/ui-bootstrap-tpls.js",
"bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js",
"bower_components/angular-bootstrap/ui-bootstrap.js",
"bower_components/angular-bootstrap/ui-bootstrap.min.js"
]
}
}
}
Your bower.json is incorrect, this part
"chartist": [
"bower_components/chartist/dist/chartist.min.js",
"bower_components/chartist/dist/chartist.min.css",
],
should be
"chartist": [
"bower_components/chartist/dist/chartist.min.js",
"bower_components/chartist/dist/chartist.min.css"
],
So drop the last comma. That comma makes the json invalid and therefore the bower installer can't parse it. I verified this with your bower.json and it works fine after removing the comma.