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

freemium's avatar

unable to install package @inertiajs/server

i was learning inertia ssr https://inertiajs.com/server-side-rendering in this documentation npm install @inertiajs/server is required to be installed when i run npm install @inertiajs/server in terminal it shows error as

C:\xampp\htdocs\learning\test_ssr_inertia>npm install @inertiajs/server
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined@undefined
npm ERR! Found: @inertiajs/[email protected]
npm ERR! node_modules/@inertiajs/inertia
npm ERR!   dev @inertiajs/inertia@"^0.10.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @inertiajs/inertia@"^0.11.0" from @inertiajs/[email protected]
npm ERR! node_modules/@inertiajs/server
npm ERR!   @inertiajs/server@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\anilk\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user1\AppData\Local\npm-cache\_logs22-02-05T17_31_12_679Z-debug.log

how can i resolve this

0 likes
4 replies
Sinnbeck's avatar

Make sure that you are running the newest versions of inertia in npm

Or post your package.json

freemium's avatar

@Sinnbeck Sir, here is my package.json file

{
    "private": true,
    "scripts": {
        "dev": "npm run development",
        "development": "mix",
        "watch": "mix watch",
        "watch-poll": "mix watch -- --watch-options-poll=1000",
        "hot": "mix watch --hot",
        "prod": "npm run production",
        "production": "mix --production",
        "ssr-dev": "mix  && mix  --mix-config=webpack.ssr.mix.js"
    },
    "devDependencies": {
        "@ckeditor/ckeditor5-basic-styles": "^31.0.0",
        "@ckeditor/ckeditor5-build-classic": "^31.0.0",
        "@ckeditor/ckeditor5-editor-classic": "^31.0.0",
        "@ckeditor/ckeditor5-essentials": "^31.0.0",
        "@ckeditor/ckeditor5-image": "^31.0.0",
        "@ckeditor/ckeditor5-link": "^31.0.0",
        "@ckeditor/ckeditor5-paragraph": "^31.0.0",
        "@ckeditor/ckeditor5-theme-lark": "^31.0.0",
        "@ckeditor/ckeditor5-vue": "^2.0.1",
        "@inertiajs/inertia": "^0.10.1",
        "@inertiajs/inertia-vue3": "^0.5.2",
        "@inertiajs/progress": "^0.2.6",
        "@tailwindcss/forms": "^0.4.0",
        "@tailwindcss/typography": "^0.5.0",
        "@vue/compiler-sfc": "^3.0.5",
        "@vueform/multiselect": "^2.3.1",
        "axios": "^0.21",
        "laravel-mix": "^6.0.6",
        "lodash": "^4.17.19",
        "postcss": "^8.1.14",
        "postcss-import": "^12.0.1",
        "tailwindcss": "^3.0.0",
        "vue": "^3.0.5",
        "vue-loader": "^16.1.2",
        "vue-multiselect": "^2.1.6",
        "vue-sweetalert2": "^5.0.2",
        "vue3-select2-component": "^0.1.7"
    },
    "dependencies": {

        "@mdi/js": "^6.5.95",
        "@vue/server-renderer": "^3.2.29",
        "bootstrap": "^5.1.3",
        "jquery": "^3.6.0",
        "mdi-vue": "^3.0.12",
        "webpack-node-externals": "^3.0.0"
    }
}

my node info

node -v :16.6.2
npm -v:7.24.1

also my composer.json file

"cviebrock/eloquent-sluggable": "^8.0",
        "fruitcake/laravel-cors": "^2.0",
        "guzzlehttp/guzzle": "^7.0.1",
        "inertiajs/inertia-laravel": "^0.5.4",
        "laravel/framework": "^8.75",
        "laravel/jetstream": "^2.5",
        "laravel/sanctum": "^2.11",
        "laravel/socialite": "^5.2",
        "laravel/tinker": "^2.5",
        "spatie/laravel-permission": "^5.4",
        "tightenco/ziggy": "^1.0",
        "yoeunes/toastr": "^1.2"

Please or to participate in this conversation.