Moment: Cannot find Moment JS Scripts after install via Nuget Package on Visual Studio 2017

Created on 17 Jul 2018  ·  7Comments  ·  Source: moment/moment

Description of the Issue and Steps to Reproduce:

  • Create a new Project "Web Application ASP.NET Core 2"
  • Open Nuget Package Console and run
    Install-Package Moment.js
    try to find Moment Script File on ASP.NET Core 2 Project after successfully installation

Result:
No package or file found on "Content/Scripts" or wwwroot/Content/Scripts or any location

Environment:
Chrome (Not matter) Windows 10 x64, Node v6.9.5

Help Wanted Up-For-Grabs

All 7 comments

Same problem here...

When you run Install-Package Moment.js, js is being saved at the path C:\Users\waseemahmad\.nuget\packages\moment.js\\2.23.0\Content\Scripts. Not sure why not saved in the solution directory.

I've had a look at this and it works with 'full-cream' .Net projects but simply doesn't work with .net core projects. The moment.nuspec and generated .nupkg are fine. As mentioned by @waseemahmad31 the scripts end up in the user's packages folder and would need to be copied (i.e. not a great solution).

According to this issue you have to use the \

I'm not sure what else we can do here.

Hi, this is still an issue with VS2019 and a asp.net core project. Installing moment via nuget doesn't copy the files into the wwwroot/lib location like it does for other js libraries like jquery and bootstrap

how are you meant to include the moment script on a view if theres no file in the project?

Seeing the same problem in VS2019 and .NET Core 3.1 with a ASP.NET Core project.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

IbraheemAlSaady picture IbraheemAlSaady  ·  3Comments

ninigix picture ninigix  ·  3Comments

slavafomin picture slavafomin  ·  3Comments

paulyoung picture paulyoung  ·  3Comments

BCup picture BCup  ·  3Comments