Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cannot find package sveltejs/adapter-auto svelte.config.js

Tags:

sveltekit

I am new to SvelteKit and have built an initial project from the SvelteKit docs. When the project opens I receive the following error when looking at index.svelte.

Error in svelte.config.js

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@sveltejs/adapter-auto' imported from /Users/.../svelte.config.js

package.json File

"devDependencies": {
        "@sveltejs/adapter-auto": "next",
        "@sveltejs/kit": "next",
        "prettier": "^2.5.1",
        "prettier-plugin-svelte": "^2.5.0",
        "svelte": "^3.44.0",
        "svelte-check": "^2.2.6",
        "typescript": "~4.6.2"
    },

svelte.config.js File

import adapter from '@sveltejs/adapter-auto';

/** @type {import('@sveltejs/kit').Config} */
const config = {
    kit: {
        adapter: adapter()
    }
};

export default config;

While the project builds it's throwing errors everywhere. Any help would be appreciated.

like image 274
jonthornham Avatar asked Sep 05 '25 02:09

jonthornham


1 Answers

I am using VS Code for the project. The issue is related to opening the project in VS Code, opening a terminal, and running the npm install command.

It appears that npm install must be run in an application like Terminal on a Mac prior to opening the app in VS Code.

like image 174
jonthornham Avatar answered Sep 07 '25 22:09

jonthornham



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!