Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error with import './dist/cli.js'; #724

Closed
Bradley-H opened this issue Mar 27, 2021 · 5 comments
Closed

error with import './dist/cli.js'; #724

Bradley-H opened this issue Mar 27, 2021 · 5 comments

Comments

@Bradley-H
Copy link

I did everything in the doc, after I npm installed and ran it gave me a handful of errors, I'll just throw it all here

0 verbose cli [ '/usr/bin/node', '/usr/local/bin/npm', 'run', 'dev' ]
1 info using [email protected]
2 info using [email protected]
3 timing config:load:defaults Completed in 1ms
4 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 2ms
5 timing config:load:builtin Completed in 2ms
6 timing config:load:cli Completed in 1ms
7 timing config:load:env Completed in 0ms
8 timing config:load:file:/home/bradley/app/.npmrc Completed in 0ms
9 timing config:load:project Completed in 0ms
10 timing config:load:file:/home/bradley/.npmrc Completed in 1ms
11 timing config:load:user Completed in 1ms
12 timing config:load:file:/etc/npmrc Completed in 0ms
13 timing config:load:global Completed in 0ms
14 timing config:load:cafile Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:setUserAgent Completed in 0ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 7ms
19 verbose npm-session 58744f2cb627bb7f
20 timing npm:load Completed in 13ms
21 timing command:run Completed in 321ms
22 verbose stack Error: command failed
22 verbose stack     at ChildProcess.proc.on (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27)
22 verbose stack     at ChildProcess.emit (events.js:198:13)
22 verbose stack     at maybeClose (internal/child_process.js:982:16)
22 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
23 verbose pkgid [email protected]
24 verbose cwd /home/bradley/app
25 verbose Linux 5.4.0-70-generic
26 verbose argv "/usr/bin/node" "/usr/local/bin/npm" "run" "dev"
27 verbose node v10.19.0
28 verbose npm  v7.6.3
29 error code 1
30 error path /home/bradley/app
31 error command failed
32 error command sh -c svelte-kit dev
33 verbose exit 1

1

@Conduitry
Copy link
Member

You need a newer version of Node. 10 isn't supported. It's going to be end-of-life in a month (https://nodejs.org/en/about/releases/) so you'll want to update for other reasons as well.

@sbutler-gh
Copy link

@Conduitry I'm on node v12.10.0 and I encountered the same issue. MacOS.

Screen Shot 2021-03-30 at 7 01 46 PM

Steps to reproduce

mkdir my-app
cd my-app
npm init svelte@next
npm install
npm run dev

Any thoughts?

@benmccann
Copy link
Member

You need at least 12.17:

I'm not exactly sure why npm is not alerting you to this fact given what's in the package.json file.

@Kamyil
Copy link

Kamyil commented Oct 5, 2021

I had the same issue. However after upgrading node version to 12.17.0 I receive following error

(node:68010) ExperimentalWarning: The ESM module loader is experimental.
(node:68010) UnhandledPromiseRejectionWarning: file:///Users/kamyil/Desktop/MyProjects/ecommerce/node_modules/@sveltejs/vite-plugin-svelte/dist/index.js:257
import { createMakeHot } from "svelte-hmr";
         ^^^^^^^^^^^^^
SyntaxError: The requested module 'svelte-hmr' does not provide an export named 'createMakeHot'
    at ModuleJob._instantiate (internal/modules/esm/module_job.js:92:21)
    at async ModuleJob.run (internal/modules/esm/module_job.js:107:20)
    at async Loader.import (internal/modules/esm/loader.js:179:24)
    at async file:///Users/kamyil/Desktop/MyProjects/ecommerce/node_modules/@sveltejs/kit/dist/cli.js:840:19
(node:68010) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:68010) [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.

@Conduitry
Copy link
Member

As indicated in https://github.com/sveltejs/kit/blob/master/packages/kit/package.json the minimum version is now 12.20, not 12.17.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants