app crashed , 显示版本不够
明明已经参照老师的配置,手动更新了package.json的babel版本,怎么还是显示错误
https://git.imooc.com/class-70/toimc-api/src/master/package.json#L48
wanglimindeMacBook-Air:8-4 wanglimin$ cd /Users/wanglimin/Desktop/resource/8-4 ; /usr/bin/env 'NODE_OPTIONS=--require "/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/ms-vscode.js-debug/src/bootloader.bundle.js" --inspect-publish-uid=http' 'VSCODE_INSPECTOR_OPTIONS={"inspectorIpc":"/var/folders/sv/bf2_bjpj5w31gnc7tl9lsq780000gn/T/node-cdp.648-11.sock","deferredMode":false,"waitForDebugger":"","execPath":"/usr/local/bin/node","onlyEntrypoint":false,"autoAttachMode":"always","fileCallback":"/var/folders/sv/bf2_bjpj5w31gnc7tl9lsq780000gn/T/node-debug-callback-ed4623aa2711fe95"}' /Users/wanglimin/Desktop/resource/8-4/node_modules/.bin/nodemon --exec babel-node ./src/index.js
Debugger attached.
[nodemon] 2.0.7
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `babel-node ./src/index.js`
Debugger attached.
Debugger attached.
Waiting for the debugger to disconnect...
/Users/wanglimin/Desktop/resource/8-4/node_modules/_babel-core@6.26.3@babel-core/lib/transformation/file/options/option-manager.js:328
throw e;
^
Error: Requires Babel "^7.0.0-0", but was loaded with "6.26.3". If you are sure you have a compatible version of @babel/core, it is likely that something in your build process is loading the wrong version. Inspect the stack trace of this error to look for the first entry that doesn't mention "@babel/core" or "babel-core" to see what is calling Babel. (While processing preset: "/Users/wanglimin/Desktop/resource/8-4/node_modules/_@babel_preset-env@7.14.4@@babel/preset-env/lib/index.js")
at throwVersionError (/Users/wanglimin/Desktop/resource/8-4/node_modules/_@babel_helper-plugin-utils@7.13.0@@babel/helper-plugin-utils/lib/index.js:78:11)
at Object.assertVersion (/Users/wanglimin/Desktop/resource/8-4/node_modules/_@babel_helper-plugin-utils@7.13.0@@babel/helper-plugin-utils/lib/index.js:28:5)
at /Users/wanglimin/Desktop/resource/8-4/node_modules/_@babel_preset-env@7.14.4@@babel/preset-env/lib/index.js:250:7
at /Users/wanglimin/Desktop/resource/8-4/node_modules/_@babel_helper-plugin-utils@7.13.0@@babel/helper-plugin-utils/lib/index.js:22:12
at /Users/wanglimin/Desktop/resource/8-4/node_modules/_babel-core@6.26.3@babel-core/lib/transformation/file/options/option-manager.js:317:46
at Array.map (<anonymous>)
at OptionManager.resolvePresets (/Users/wanglimin/Desktop/resource/8-4/node_modules/_babel-core@6.26.3@babel-core/lib/transformation/file/options/option-manager.js:275:20)
at OptionManager.mergePresets (/Users/wanglimin/Desktop/resource/8-4/node_modules/_babel-core@6.26.3@babel-core/lib/transformation/file/options/option-manager.js:264:10)
at OptionManager.mergeOptions (/Users/wanglimin/Desktop/resource/8-4/node_modules/_babel-core@6.26.3@babel-core/lib/transformation/file/options/option-manager.js:249:14)
at OptionManager.init (/Users/wanglimin/Desktop/resource/8-4/node_modules/_babel-core@6.26.3@babel-core/lib/transformation/file/options/option-manager.js:368:12)
at compile (/Users/wanglimin/Desktop/resource/8-4/node_modules/_babel-register@6.26.0@babel-register/lib/node.js:103:45)
at loader (/Users/wanglimin/Desktop/resource/8-4/node_modules/_babel-register@6.26.0@babel-register/lib/node.js:144:14)
at Object.require.extensions.<computed> [as .js] (/Users/wanglimin/Desktop/resource/8-4/node_modules/_babel-register@6.26.0@babel-register/lib/node.js:154:7)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at Object.<anonymous> (/Users/wanglimin/Desktop/resource/8-4/node_modules/_babel-cli@6.26.0@babel-cli/lib/_babel-node.js:154:22)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47 {
code: 'BABEL_VERSION_UNSUPPORTED',
version: '6.26.3',
range: '^7.0.0-0'
}
Waiting for the debugger to disconnect...
[nodemon] app crashed - waiting for file changes before starting...
其实一开始是是运行正常的, 不知道为什么debug的时候 在监视窗口增加了一个ctx看就开始出现这个情况,接下来就是 “npm run start”都出错了。
其他可能相关设置:launch.json, (有些默认的没有改,和课程里有点不同,但是第一次运行的时候是正常的)
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"name": "nodemon",
"program": "${workspaceFolder}/src/index.js",
"request": "launch",
"restart": true,
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/nodemon",
"skipFiles": [
"<node_internals>/**"
],
"type": "pwa-node",
"runtimeArgs": ["--exec", "babel-node"]
}
]
}
10
收起
正在回答 回答被采纳积分+1
1回答
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星