S
S
Sergey Konstantinov2021-01-18 19:11:15
npm
Sergey Konstantinov, 2021-01-18 19:11:15

Why error in npm run dev for laravel?

}
npm ERR! code 1
npm ERR! path F:\OpenServer\domains\laravel\example-app
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\sfwnh_89s4tn3\AppData\Roaming\npm-cache\_logs\2021-01-18T16_01_54_855Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\sfwnh_89s4tn3\AppData\Roaming\npm-cache\_logs\2021-01-18T16_01_54_889Z-debug.log


log file sofuwa.ru/log.txt
console content sofuwa.ru/console.txt
like everything you need is installed, laravel installed via composer

Answer the question

In order to leave comments, you need to log in

5 answer(s)
D
Dmitry, 2021-01-18
@DKWLB

Maybe naive, but did you do npm install from the project folder? After installing laravel.

A
Anton, 2017-05-19
@viktorulyushev

It depends where you want to get it.
Judging by the name of the attribute, this is your AngularJS, so somewhere there must be a controller for which this piece of html is a template. You can search for scripts on the $scope.bonusInfo line.
If you need to get in jquery, then there is a .data() method;
It works like this:
$(element).data('ng-bind');
And how to display - it depends on where you want to display it.

A
Artem, 2017-05-19
@devspec

$("span").attr("data-ng-bind")
ruseller.com/jquery.php?id=43

Y
Yevgeniy Kisselyov, 2017-05-19
@ewgenio

var data = $("span").data();
alert(data.ngBind);
// или
alert($("span").data('ngBind'););

https://api.jquery.com/data/

A
Alexander Ter, 2017-05-19
@alexsandr0000

For OOP, I think it will be necessary to create a class describing the xml structure ( description ), specifically for this fragment, this class will look like this:

using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.Serialization;
using System.Xml.Serialization;

[DataContract(Name = "span")]
public class Span
{
  /// <summary>
    /// 
    /// </summary>
    [XmlAttribute("class")]
    public string VerticalInterval { get; set; }
  
    /// <summary>
    /// 
    /// </summary>
    [XmlAttribute("data-ng-bind")]
    public string DataNgBind{ get; set; }
}

You can use the following class to serialize and deserialize a Span:
namespace Common
{
    using System.IO;
    using System.Xml.Serialization;

    public static class Serialization
    {
        public static string SerializeToString(this object obj)
        {
            var xmlSerializer = new XmlSerializer(obj.GetType());
            var stringWriter = new StringWriter();
            xmlSerializer.Serialize(stringWriter, obj);
            return stringWriter.ToString();
        }

        public static T DeserializeString<T>(this string sourceString)
        {
            var xmlSerializer = new XmlSerializer(typeof(T));
            var stringReader = new StringReader(sourceString);
            return (T)xmlSerializer.Deserialize(stringReader);
        }
    }
}

or you can do it like this:
var _span = new Span();
_span.VerticalInterval = "vertical-interval-xsmall form-field-input";
_span.DataNgBind = "bonusInfo.bonusData.CardNumber";

// передаем в конструктор тип класса
XmlSerializer formatter = new XmlSerializer(_span.GetType());
using (FileStream fs = new FileStream("model.xml", FileMode.OpenOrCreate))
{
  formatter.Serialize(fs, _span);
  Console.WriteLine("Объект сериализован");
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question