在ReactJS中设置Less时出错

时间:2018-04-12 03:49:09

标签: reactjs less

我正在尝试在Reactjs中设置Less,并且我正在遵循本教程create-react-app。我的问题是,在执行这些步骤后,我收到了此错误消息

  

'react-scripts'未被识别为内部或外部命令,   可操作程序或批处理文件。

当我在package.json上添加新命令时显示此错误

"scripts": {
     "build-css": "node-sass-chokidar src/ -o src/",
     "watch-css": "npm run build-css && node-sass-chokidar src/ -o src/ --watch --recursive",
-    "start": "react-scripts start",
-    "build": "react-scripts build",
+    "start-js": "react-scripts start",
+    "start": "npm-run-all -p watch-css start-js",
+    "build-js": "react-scripts build",
+    "build": "npm-run-all build-css build-js",
     "test": "react-scripts test --env=jsdom",
     "eject": "react-scripts eject"
   }

我不知道该怎么做。 希望你了解我。

感谢。

1 个答案:

答案 0 :(得分:2)

您是否已将package.json添加到npm install?如果没有,请执行此操作, Sub read_file_do_something_and_insert_table() Dim t As Task Dim FULLPATH As String = "" Dim i As Integer = 0 Dim arr() As String Try Using oReader As StreamReader = New StreamReader(FULLPATH) While Not oReader.EndOfStream Try i = i + 1 arr = oReader.ReadLine.Split(vbTab) t = New Task(Sub() multiTask({arr(0)})) t.Start() Me.Text = i Catch ex As Exception MsgBox(ex.Message) End Try End While End Using Catch ex As Exception MsgBox(ex.Message) End Try t.Wait() MsgBox("Successfully completed.") Me.Enabled = True End Sub Sub multiTask(ByVal Params() As Object) Using oConn As SqlConnection = New SqlConnection(ConnectionString) Using oCmd As SqlCommand = New SqlCommand oConn.Open() oCmd.Connection = oConn oCmd.Parameters.Clear() oCmd.CommandText = "[dbo].[PROC_THAT_DO_SOME_TREATMENTS_AND_INSERT_IN_A_TABLE]" oCmd.CommandType = CommandType.StoredProcedure oCmd.Parameters.AddWithValue("@ID", Params(0)) oCmd.ExecuteNonQuery() End Using End Using End Sub 并继续!