之前也有人问过类似的问题,我已经尝试了一切。
我使用create-react-app创建了一个react应用,并在昨天的npm start上运行良好。正如您可能会从下面的文件夹名称中收集的那样,它是d3应用程序,但这与我认为无关紧要。
我今天尝试运行该应用,但无法运行。我收到标准错误消息。我的debug.log看起来像这样:
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 npm@6.13.4
3 info using node@v12.16.1
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle 06-components-responsive@0.1.0~prestart: 06-components-responsive@0.1.0
6 info lifecycle 06-components-responsive@0.1.0~start: 06-components-responsive@0.1.0
7 verbose lifecycle 06-components-responsive@0.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle 06-components-responsive@0.1.0~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\***\Documents\d3-examples\responsive-bar\node_modules\.bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Program Files\Git\bin\;C:\Program Files\Git\cmd\;C:\Program Files\nodejs\;";C:\Program Files\nodejs\";C:\Program Files\PuTTY\;C:\Users\***\AppData\Local\Microsoft\WindowsApps;;C:\Users\***\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\***\AppData\Roaming\npm;C:\Program Files\JetBrains\PyCharm 2020.1.1\bin;;C:\Program Files\JetBrains\PyCharm Professional Edition with Anaconda plugin 2020.1.1\bin;
9 verbose lifecycle 06-components-responsive@0.1.0~start: CWD: C:\Users\***\Documents\d3-examples\responsive-bar
10 silly lifecycle 06-components-responsive@0.1.0~start: Args: [ '/d /s /c', 'react-scripts start' ]
11 silly lifecycle 06-components-responsive@0.1.0~start: Returned: code: 1 signal: null
12 info lifecycle 06-components-responsive@0.1.0~start: Failed to exec start script
13 verbose stack Error: 06-components-responsive@0.1.0 start: `react-scripts start`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:311:20)
13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:311:20)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid 06-components-responsive@0.1.0
15 verbose cwd C:\Users\***\Documents\d3-examples\responsive-bar
16 verbose Windows_NT 10.0.18362
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v12.16.1
19 verbose npm v6.13.4
20 error code ELIFECYCLE
21 error errno 1
22 error 06-components-responsive@0.1.0 start: `react-scripts start`
22 error Exit status 1
23 error Failed at the 06-components-responsive@0.1.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
我听不懂调试日志-什么是
unsafe-perm in lifecycle true
这有关系吗?
为什么要在PyCharm中查看?
我上周创建的create-react-app项目没有任何用,但是几个月前我用create-react-app创建的一个大项目仍然可以在npm start下使用。
任何帮助表示赞赏!