question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find module '/home/nik/.npm/_npx/.../node_modules/create-svelte/index.js'

See original GitHub issue

Describe the bug

After running the command npm init svelte@next myapp I am getting the error down below [see logs]. I included the npm logs as well…

Reproduction

No idea how to reproduce this bug…

Logs

internal/process/esm_loader.js:74
    internalBinding('errors').triggerUncaughtException(
                              ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/nik/.npm/_npx/bbf9a9d70dc325b0/node_modules/create-svelte/index.js' imported from /home/nik/.npm/_npx/bbf9a9d70dc325b0/node_modules/create-svelte/bin.js
    at new NodeError (internal/errors.js:322:7)
    at finalizeResolution (internal/modules/esm/resolve.js:308:11)
    at moduleResolve (internal/modules/esm/resolve.js:731:10)
    at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:842:11)
    at Loader.resolve (internal/modules/esm/loader.js:89:40)
    at Loader.getModuleJob (internal/modules/esm/loader.js:242:28)
    at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:76:40)
    at link (internal/modules/esm/module_job.js:75:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}
npm ERR! code 1
npm ERR! path /home/nik/code
npm ERR! command failed
npm ERR! command sh -c create-svelte "myapp"

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/nik/.npm/_logs/2022-01-20T14_49_48_597Z-debug-0.log



More logs:...


0 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'init', 'svelte@next', 'myapp' ]
1 info using npm@8.3.1
2 info using node@v14.18.3
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 2ms
5 timing config:load:file:/usr/lib/node_modules/npm/npmrc Completed in 3ms
6 timing config:load:builtin Completed in 3ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:/home/nik/code/.npmrc Completed in 0ms
10 timing config:load:project Completed in 1ms
11 timing config:load:file:/home/nik/.npmrc Completed in 1ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:/usr/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:credentials Completed in 2ms
17 timing config:load:setEnvs Completed in 0ms
18 timing config:load Completed in 10ms
19 timing npm:load:configload Completed in 10ms
20 timing npm:load:setTitle Completed in 1ms
21 timing config:load:flatten Completed in 2ms
22 timing npm:load:display Completed in 3ms
23 verbose logfile /home/nik/.npm/_logs/2022-01-20T14_49_48_597Z-debug-0.log
24 timing npm:load:logFile Completed in 3ms
25 timing npm:load:timers Completed in 0ms
26 timing npm:load:configScope Completed in 0ms
27 timing npm:load Completed in 18ms
28 silly logfile start cleaning logs, removing 1 files
29 http fetch GET 200 https://registry.npmjs.org/create-svelte 209ms (cache revalidated)
30 timing arborist:ctor Completed in 2ms
31 timing arborist:ctor Completed in 0ms
32 timing arborist:ctor Completed in 0ms
33 timing command:init Completed in 301ms
34 verbose stack Error: command failed
34 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27)
34 verbose stack     at ChildProcess.emit (events.js:400:28)
34 verbose stack     at maybeClose (internal/child_process.js:1058:16)
34 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)
35 verbose cwd /home/nik/code
36 verbose Linux 5.10.16.3-microsoft-standard-WSL2
37 verbose argv "/usr/bin/node" "/usr/bin/npm" "init" "svelte@next" "myapp"
38 verbose node v14.18.3
39 verbose npm  v8.3.1
40 error code 1
41 error path /home/nik/code
42 error command failed
43 error command sh -c create-svelte "myapp"
44 verbose exit 1
45 timing npm Completed in 602ms
46 verbose code 1
47 error A complete log of this run can be found in:
47 error     /home/nik/.npm/_logs/2022-01-20T14_49_48_597Z-debug-0.log

System Info

System:
    OS: Linux 5.10 Ubuntu 20.04.3 LTS (Focal Fossa)
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 11.76 GB / 12.28 GB
    Container: Yes
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 14.18.3 - /usr/bin/node
    Yarn: 1.22.17 - /usr/bin/yarn
    npm: 8.3.1 - /usr/bin/npm

Severity

blocking all usage of SvelteKit

Additional Information

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Rich-Harriscommented, Jan 20, 2022

I just released a new version, can you see if it’s fixed?

0reactions
Mlocik97commented, Jan 20, 2022

oh yeah it works… not sure why didn’t work just npm init svelte@next as I cleared cache npm cache clean --force and also deleted ~/.npm folder

E: ok ,npm init svelte@next works not too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

cannot find module [Node npm Error Solved] - freeCodeCamp
In my case, I got it like this "Module not found: Error: Can't resolve 'react-icons/fa' in 'C:\Users\user\Desktop\Projects\Address Locator\ ...
Read more >
How do I resolve "Cannot find module" error using Node.js?
Using npm install installs the module into the current directory only (in a subdirectory called node_modules ). Is app.js located under ...
Read more >
Cannot find module in core-js when running from NPX #551
Before the latest change, all was fine, but now if I try to run npx bolt --version on CircleCI I get this error...
Read more >
How do I build a Lambda deployment package for Node.js?
I created an AWS Lambda function in Node.js, but I get a "Cannot ... The Cannot find module error usually occurs for one...
Read more >
[Solution] Error: Cannot Find Module "nodemailer" - Courier
What's Causing This Error? This error occurs when you have not installed the nodemailer library in your Node.js application.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found