Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
22
rated 0 times [  29] [ 7]  / answers: 1 / hits: 9162  / 3 Years ago, sun, january 10, 2021, 12:00:00

After creating a react application, when I run the command npm start I have the following error:


PS G:workspaceWEBgab-webclient> npm start

> [email protected] start G:workspaceWEBgab-webclient
> react-scripts start

internal/modules/cjs/loader.js:628
throw e;
^

Error: No valid exports main found for 'G:workspaceWEBgab-webclientnode_modulespostcss-safe-parsernode_modulespostcss'
at resolveExportsTarget (internal/modules/cjs/loader.js:625:9)
at applyExports (internal/modules/cjs/loader.js:502:14)
at resolveExports (internal/modules/cjs/loader.js:551:12)
at Function.Module._findPath (internal/modules/cjs/loader.js:657:22)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:960:27)
at Function.Module._load (internal/modules/cjs/loader.js:855:27)
at Module.require (internal/modules/cjs/loader.js:1033:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (G:workspaceWEBgab-webclientnode_modulespostcss-safe-parserlibsafe-parse.js:1:17)
at Module._compile (internal/modules/cjs/loader.js:1144:30) {
code: 'MODULE_NOT_FOUND'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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:
npm ERR! C:UsersgabriAppDataRoamingnpm-cache_logs2021-01-10T19_26_53_509Z-debug.log

And here's the full log file :


0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'start'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 info lifecycle [email protected]~start: [email protected]
7 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~start: PATH: C:Program Filesnodejsnode_modulesnpmnode_modulesnpm-lifecyclenode-gyp-bin;G:workspaceWEBgab-webclientnode_modules.bin;C:Program Files (x86)Common FilesIntelShared Librariesredistintel64compiler;C:Program Files (x86)Common FilesOracleJavajavapath;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShellv1.0;C:WindowsSystem32OpenSSH;C:Program Files (x86)NVIDIA CorporationPhysXCommon;C:Usersgabri.dnxbin;C:Program FilesMicrosoft DNXDnvm;C:Program FilesMicrosoft SQL Server130ToolsBinn;C:Program FilesNVIDIA CorporationNVIDIA NvDLISR;C:Program Filesdotnet;C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;C:WINDOWSSystem32WindowsPowerShellv1.0;C:WINDOWSSystem32OpenSSH;C:Program FilesJavajdk1.8.0_221bin;C:Program FilesWorldPainter;C:Program Filesnodejs;C:Program FilesGitcmd;C:UsersgabriAppDataLocalProgramsPythonPython38-32Scripts;C:UsersgabriAppDataLocalProgramsPythonPython38-32;C:UsersgabriAppDataLocalMicrosoftWindowsApps;C:UsersgabriAppDataRoamingDashlane6.1937.0.23352binFirefox_Extension{442718d9-475e-452a-b3e1-fb1ee16b8e9f}components;C:UsersgabriAppDataRoamingDashlane6.1937.0.23352ucrt;C:UsersgabriAppDataRoamingDashlane6.1937.0.23352binQt;C:UsersgabriAppDataRoamingDashlane6.1937.0.23352binSsl;C:UsersgabriAppDataRoamingnpm;D:workspaceffmpegbin;C:UsersgabriAppDataLocalatombin;C:UsersgabriAppDataLocalProgramsMicrosoft VS Codebin;C:UsersgabriAppDataLocalMicrosoftWindowsApps;C:UsersgabriAppDataLocalGitHubDesktopbin
9 verbose lifecycle [email protected]~start: CWD: G:workspaceWEBgab-webclient
10 silly lifecycle [email protected]~start: Args: [ '/d /s /c', 'react-scripts start' ]
11 silly lifecycle [email protected]~start: Returned: code: 1 signal: null
12 info lifecycle [email protected]~start: Failed to exec start script
13 verbose stack Error: [email protected] start: `react-scripts start`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:Program Filesnodejsnode_modulesnpmnode_modulesnpm-lifecycleindex.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:321:20)
13 verbose stack at ChildProcess.<anonymous> (C:Program Filesnodejsnode_modulesnpmnode_modulesnpm-lifecyclelibspawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:321:20)
13 verbose stack at maybeClose (internal/child_process.js:1028:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid [email protected]
15 verbose cwd G:workspaceWEBgab-webclient
16 verbose Windows_NT 10.0.19042
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "start"
18 verbose node v13.6.0
19 verbose npm v6.13.4
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] start: `react-scripts start`
22 error Exit status 1
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

More From » node.js

 Answers
2

Try upgrading your npm to v14.5 or later, also remove react-create-app globally:


npm uninstall -g create-react-app

and then try recreating your project:


npx create-react-app myapp

It's a known issue, credits: https://github.com/facebook/create-react-app/issues/9273#issuecomment-654182223


[#1987] Tuesday, January 5, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jaredsages

Total Points: 273
Total Questions: 97
Total Answers: 105

Location: French Southern and Antarctic Lands
Member since Fri, Jan 6, 2023
1 Year ago
;