ASP.NET Core : package.json is missing
Asked Answered
E

4

5

As per the following link: when creating ASP.NET Core App, You have just show all files in solution to find the package.json, but in my case i am not able to find it. I need to add angular2 and WebPack dependencies.

So what is the problem?

Ebro answered 5/10, 2016 at 16:39 Comment(2)
(I don't have enough reputation to add notes to other answers yet.) Vasanth: I think they are talking about the package.json used by npm. The project.json file, on the other hand, is (or... was) the ASP.NET project file.Kaltman
Yes, Exactly that was for npmEbro
N
6

You can add package.json in Visual Studio 2015 like this-

Right click on Project > Add > New Item. In new Item popup window, you can select npm configuration file like below-

package.json

Numerous answered 5/10, 2016 at 16:59 Comment(2)
But, why its not added by default?Ebro
I m not sure... but probably because npm consider as external toolsNumerous
S
1

I'm not a front end expert but I do recall during one of the ASP.NET community standups Mads Kristensen talking about a bundling and minification changes that I think may have replaced gulp etc as the default. Maybe the default template no longer pulls in npm because of that?

I can see bower only in the new ASP.NET core template.

But as Sanket says, you can add in what you want.

Links to the bundler/minifier stuff below:

https://youtu.be/p6NUkeTVsGE?list=PL0M0zPgJ3HSftTAAHttA3JQU4vOjXFquF - Mads talking on bundling.

https://github.com/madskristensen/BundlerMinifier/wiki

https://visualstudiogallery.msdn.microsoft.com/9ec27da7-e24b-4d56-8064-fd7e88ac1c40

Secern answered 6/10, 2016 at 6:58 Comment(0)
A
0

You should use npm init -y to initialise package.json.

Aerology answered 18/1, 2021 at 16:2 Comment(0)
B
0

This happened to me recently, too. Reason for not generating package.json was old node.js version. If you searching for solution to this problem, try creating standalone vue project with node. If you get TypeError, it's most likely old node version

Braun answered 12/6 at 16:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.