RSamaium / RPG-JS

Framework to create an RPG or MMORPG (with the same code) in the browser with Typescript
https://rpgjs.dev
MIT License
1.36k stars 205 forks source link

npm ERR! when `npm install` #152

Closed LehaoLin closed 2 years ago

LehaoLin commented 2 years ago

Node version v14.18.3 OS: macOS Monterey 12.2.1 Error screenshot:

image
RSamaium commented 2 years ago

Hello,

Thanks for the feedback. But the addiction you blurred is simply not available on NPM (why did you blur it?)

Edit: Nothing to do (I misread the error :laughing: )

LehaoLin commented 2 years ago

I just blur my root directory name (as project name), which I think it is no relation to the error.

RSamaium commented 2 years ago

Ok, can you share the content of package.json ?

LehaoLin commented 2 years ago

Error solved after I install the "@rpgjs/standalone" without the version 3.0.0-beta.9. npm i @rpgjs/standalone -s And the item in package.json be [after change the @rpgjs-standalone package version, original version "@rpgjs/standalone": "^3.0.0-beta.9",]


{
    "name": "my-game",
    "version": "3.0.0-beta",
    "description": "",
    "main": "dist/server.js",
    "types": "index.d.ts",
    "publishConfig": {
        "access": "public"
    },
    "scripts": {
        "test": "NODE_ENV=test jest",
        "build": "rimraf dist && rpgjs build",
        "dev": "rpgjs dev",
        "start": "node dist/server"
    },
    "keywords": [],
    "author": "",
    "license": "MIT",
    "engines": {
        "node": "<15"
    },
    "dependencies": {
        "@rpgjs/client": "^3.0.0-beta.9",
        "@rpgjs/default-gui": "^3.0.0-beta.9",
        "@rpgjs/gamepad": "^3.0.0-beta.9",
        "@rpgjs/mobile-gui": "^3.0.0-beta.9",
        "@rpgjs/server": "^3.0.0-beta.9",
        "@rpgjs/standalone": "^3.0.0-beta-1",
        "@rpgjs/testing": "^3.0.0-beta.9",
        "express": "4.17.1",
        "pretty-error": "^4.0.0",
        "socket.io": "4.1.2",
        "socket.io-client": "4.1.2",
        "vue": "^3.2.36"
    },
    "devDependencies": {
        "@rpgjs/compiler": "^3.0.0-beta.9",
        "@types/jest": "26.0.23",
        "@vue/cli-plugin-babel": "^5.0.4",
        "@vue/compiler-sfc": "3.2.33",
        "@vue/vue3-jest": "27.0.0-alpha.4",
        "canvas": "2.8.0",
        "jest": "27.0.4",
        "rimraf": "3.0.2",
        "ts-jest": "27.0.2",
        "typescript": "4.3.2"
    }
}
RSamaium commented 2 years ago

Normally, the package exists

npm i @rpgjs/standalone@3.0.0-beta.9

Note: It's a package for the RPG mode, no impact if you make an MMORPG

LehaoLin commented 2 years ago

I find the reason why the error happened finally! Because I am in China, and usually the network connecting to npm is not stable. So, most Chinese developers, including me, would use taobao's npm mirror, which is https://npmmirror.com/. However, the package @rpgjs/standalone seems not sync with the npm official on time. (Maybe since rare use from China) Therefore, the local npm can't find the correct version of the @rpgjs/standalone. After I change my npm config from taobao's mirror back to npm official one, the error disappears. Hope others who may meet this problem in the future would see this solution. 💪🏻