如何解决错误:找不到模块“ glob”

时间:2019-10-05 19:36:32

标签: node.js reactjs

我最近安装了react和node.js,以便在Visual Studio中将其用于Web应用程序开发。我不断收到与上述错误类似的错误。我已经尝试了各种来自Internet的解决方案,但没有用。 我能够找到其他模块所在的地方。

我尝试过的一些解决方案是: npm install-保存glob npm更新 和别的 我正在使用 Windows 10 这是输出消息:

An unhandled exception occurred while processing the request.
AggregateException: One or more errors occurred. (One or more errors occurred. (The NPM script 'start' exited without indicating that the create-react-app server was listening for requests. The error output was: internal/modules/cjs/loader.js:638

throw err;
^

Error: Cannot find module 'glob'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)

at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (C:\Program Files\rimraf\rimraf.js:7:12)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! webapplication1@0.1.0 start: `rimraf ./build && react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the webapplication1@0.1.0 start 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:

))
System.Threading.Tasks.Task.ThrowIfExceptional(bool includeTaskCanceledExceptions)

InvalidOperationException: The NPM script 'start' exited without indicating that the create-react-app server was listening for requests. The error output was: internal/modules/cjs/loader.js:638

throw err;
^

Error: Cannot find module 'glob'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)

at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (C:\Program Files\rimraf\rimraf.js:7:12)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! webapplication1@0.1.0 start: `rimraf ./build && react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the webapplication1@0.1.0 start 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:

Microsoft.AspNetCore.SpaServices.ReactDevelopmentServer.ReactDevelopmentServerMiddleware.StartCreateReactAppServerAsync(string sourcePath, string npmScriptName, ILogger logger)

Stack Query Cookies Headers Routing
AggregateException: One or more errors occurred. (One or more errors occurred. (The NPM script 'start' exited without indicating that the create-react-app server was listening for requests. The error output was: internal/modules/cjs/loader.js:638 throw err; ^ Error: Cannot find module 'glob' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function.Module._load (internal/modules/cjs/loader.js:562:25) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at Object.<anonymous> (C:\Program Files\rimraf\rimraf.js:7:12) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! webapplication1@0.1.0 start: `rimraf ./build && react-scripts start` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the webapplication1@0.1.0 start 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: ))
System.Threading.Tasks.Task.ThrowIfExceptional(bool includeTaskCanceledExceptions)
System.Threading.Tasks.Task<TResult>.GetResultCore(bool waitCompletionNotification)
System.Threading.Tasks.Task<TResult>.get_Result()
Microsoft.AspNetCore.SpaServices.Extensions.Util.TaskTimeoutExtensions.WithTimeout<T>(Task<T> task, TimeSpan timeoutDelay, string message)
Microsoft.AspNetCore.SpaServices.Extensions.Proxy.SpaProxy.PerformProxyRequest(HttpContext context, HttpClient httpClient, Task<Uri> baseUriTask, CancellationToken applicationStoppingToken, bool proxy404s)
Microsoft.AspNetCore.Builder.SpaProxyingExtensions+<>c__DisplayClass2_0+<<UseProxyToSpaDevelopmentServer>b__0>d.MoveNext()
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

Show raw exception details
InvalidOperationException: The NPM script 'start' exited without indicating that the create-react-app server was listening for requests. The error output was: internal/modules/cjs/loader.js:638 throw err; ^ Error: Cannot find module 'glob' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function.Module._load (internal/modules/cjs/loader.js:562:25) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at Object.<anonymous> (C:\Program Files\rimraf\rimraf.js:7:12) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! webapplication1@0.1.0 start: `rimraf ./build && react-scripts start` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the webapplication1@0.1.0 start 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:
Microsoft.AspNetCore.SpaServices.ReactDevelopmentServer.ReactDevelopmentServerMiddleware.StartCreateReactAppServerAsync(string sourcePath, string npmScriptName, ILogger logger)

Show raw exception details

0 个答案:

没有答案