(npm run watch)失败时如何编译sass文件

时间:2019-01-01 15:13:35

标签: node.js npm laravel-5.6

我正在尝试编译laravel sass文件以应用更改,但是每次我运行(private void DataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) { if (dataGridView1?.CurrentCell?.OwningColumn?.Name != "CategoryIdColumn") return; var combo = e.Control as DataGridViewComboBoxEditingControl; if (combo == null) return; combo.DrawMode = DrawMode.OwnerDrawFixed; combo.DrawItem += (obj, args) => { var txt = args.Index >= 0 ? combo.GetItemText(combo.Items[args.Index]) : ""; var textColor = args.Index == 0 ? SystemColors.GrayText : SystemColors.ControlText; var font = args.Index == 0 ? new Font(combo.Font, FontStyle.Italic) : combo.Font; if ((args.State & DrawItemState.Selected) == DrawItemState.Selected) { textColor = SystemColors.HighlightText; } args.DrawBackground(); TextRenderer.DrawText(args.Graphics, txt, font, args.Bounds, textColor, TextFormatFlags.VerticalCenter | TextFormatFlags.Left); }; } 或(private void DataGridView1_CellPainting(object sender, DataGridViewCellPaintingEventArgs e) { if (e.ColumnIndex < 0 || e.RowIndex < 0 || dataGridView1.Columns[e.ColumnIndex].Name != "CategoryIdColumn") return; if (dataGridView1[e.ColumnIndex, e.RowIndex].Value == DBNull.Value) { e.CellStyle.Font = new Font(e.CellStyle.Font, FontStyle.Italic); e.CellStyle.ForeColor = SystemColors.GrayText; } else { e.CellStyle.Font = new Font(e.CellStyle.Font, FontStyle.Regular); e.CellStyle.ForeColor = SystemColors.ControlText; } } )时,我都会遇到这些错误...

npm run watch

npm run dev

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @ development: cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch" npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @ development script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

1 个答案:

答案 0 :(得分:0)

问题在于此错误是因为没有 node_modules

Laravel Mix Documentation指出:

您必须运行 npm install 来下载Laravel Mix所需的所有软件包。

如果您具有 node_module 文件夹,则将其删除并再次运行 npm install