Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

haim's avatar
Level 6

@inertiajs/inertia directory is missing innode_modules, how to install it?

Hi. I have a project where I used Breeze and it all works well (I installed that project a few months ago). I copied setting from that project to a new project this week and everything is the same but one thing.

I get this error: [plugin:vite:import-analysis] Failed to resolve import "@inertiajs/inertia" from "resources/js/Pages/Admin/AddSong.vue". Does the file exist?

When I look at node_modules "@inertiajs" directory, I see in the original project the directories: "inertia", "inertia-vue3" and "progress". but on my new project the directories "inertia" and "inertia-vue3" does not exist. All I have there is "core" and "vue3" directories.

a bit more information - I"m trying to use Inertia.post, however I don't think it is related. I'm pretty sure that getting the "inertia" directory in "@inertiajs" will solve my problem.

Anyone knows why this happens and how to solve it? Thanks.

0 likes
4 replies
haim's avatar
Level 6

@Sinnbeck

{
    "private": true,
    "scripts": {
        "dev": "vite",
        "build": "vite build"
    },
    "devDependencies": {
        "@inertiajs/vue3": "^1.0.0",
        "@tailwindcss/forms": "^0.5.3",
        "@vitejs/plugin-vue": "^4.0.0",
        "autoprefixer": "^10.4.12",
        "axios": "^1.1.2",
        "laravel-vite-plugin": "^0.7.2",
        "lodash": "^4.17.19",
        "postcss": "^8.4.18",
        "tailwindcss": "^3.2.1",
        "vite": "^4.0.0",
        "vue": "^3.2.41"
    }
}
haim's avatar
Level 6

@Sinnbeck Thank you very much. I read the guide, and replaced Inertia import with router import and it solved my problem. Appreciated, Haim.

Please or to participate in this conversation.