【发布时间】:2020-12-13 15:15:14
【问题描述】:
我想试用 Sapper 的新 SvelteKit 替代品,但我无法启动开发服务器。
我跑了:
npm init svelte@next
npm install
npm run dev -- --open
错误:
(node:16570) UnhandledPromiseRejectionWarning: .../Desktop/Programming/Web Development/Svelte/Demo-app/node_modules/@sveltejs/kit/dist/index4.js:262
#map;
^
SyntaxError: Invalid or unexpected token
at Module._compile (internal/modules/cjs/loader.js:723:23)
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)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (../Desktop/Programming/Web Development/Svelte/Demo-app/node_modules/@sveltejs/kit/dist/index.js:13:13)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
(node:16570) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:16570) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
我没有碰过生成的代码。
我知道当服务器启动时无法打开新的浏览器选项卡时会弹出这类错误,但我不知道如何在此处修复。
- 节点版本:v10.19.0
- 操作系统:Ubuntu 20.04.1 LTS,64 位
- 浏览器:Firefox 83.0(64 位)
- 代理:Burp Suite
【问题讨论】:
标签: javascript node.js svelte