(v1.16.0) Error: ENOENT: no such file or directory, open '/nodebb/node_modules/nodebb-plugin-require/plugin.json'

  • Anime Lovers

    Hello, I upgraded from v1.12.1 to v1.16.0 after importing things from mybb to nodebb.

    After upgrade, whenever I go into admin plugin page
    (http://localhost:4567/admin/extend/plugins), log generates following error:

    2020-12-25T17:06:46.163Z [4567/4022] - error: Error: ENOENT: no such file or directory, open '/home/myid/nodebb/node_modules/nodebb-plugin-require/plugin.json'
    2020-12-25T17:06:46.643Z [4567/4022] - error: Error: ENOENT: no such file or directory, open '/home/myid/nodebb/node_modules/nodebb-plugin-require/plugin.json'
    

    It generates same message 2 times each time I go to that page.

    Following is code in nodebb/node_modules/nodebb-plugin-require/plugin.json:

    {
      "_from": "nodebb-plugin-require@^0.0.6",
      "_id": "nodebb-plugin-require@0.0.6",
      "_inBundle": false,
      "_integrity": "sha512-sa3lhcrDsvgo/IwtluW9VrCXECEDb7e9QRSI1Rmdc4+Smnkuzyf0xWY0GVXSU3L8XWPDTztKcnxR9RRo6E2x+A==",
      "_location": "/nodebb-plugin-require",
      "_phantomChildren": {},
      "_requested": {
        "type": "range",
        "registry": true,
        "raw": "nodebb-plugin-require@^0.0.6",
        "name": "nodebb-plugin-require",
        "escapedName": "nodebb-plugin-require",
        "rawSpec": "^0.0.6",
        "saveSpec": null,
        "fetchSpec": "^0.0.6"
      },
      "_requiredBy": [
        "/nodebb-plugin-import"
      ],
      "_resolved": "https://registry.npmjs.org/nodebb-plugin-require/-/nodebb-plugin-require-0.0.6.tgz",
      "_shasum": "14c7642996afef7a504c34e8a54d5753e5bd55f3",
      "_spec": "nodebb-plugin-require@^0.0.6",
      "_where": "/home/myid/nodebb/node_modules/nodebb-plugin-import",
      "author": {
        "name": "https://github.com/akhoury"
      },
      "bugs": {
        "url": "https://github.com/akhoury/nodebb-plugin-require/issues"
      },
      "bundleDependencies": false,
      "deprecated": false,
      "description": "Easily require NodeBB/src modules from within any plugin when running that as a stand-alone script",
      "homepage": "https://github.com/akhoury/nodebb-plugin-require#readme",
      "license": "MIT",
      "main": "index.js",
      "name": "nodebb-plugin-require",
      "nbbpm": {
        "compatibility": "*",
        "index": false
      },
      "repository": {
        "type": "git",
        "url": "git+https://github.com/akhoury/nodebb-plugin-require.git"
      },
      "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1"
      },
      "version": "0.0.6"
    }
    

    I used following commands when upgrading (Ubuntu 18.04.4 LTS):
    nvm install v14.15.3 # In order to upgrade node.js version to install higher nodebb version
    nvm use v14.15.3 # In order to upgrade node.js version to install higher nodebb version
    nvm alias default v14.15.3 # In order to upgrade node.js version to install higher nodebb version
    git fetch
    git reset --hard origin/v1.16.x
    ./nodebb reset plugins # only if it generates "Error: EMFILE: too many open files" error while upgrading
    ./nodebb reset themes # only if it generates "Error: EMFILE: too many open files" error while upgrading
    ./nodebb upgrade

    Thank you very much.

  • Global Moderator Plugin & Theme Dev

    @noob111 I can almost guarantee you posted the contents of package.json, not plugin.json.

  • Anime Lovers

    @pitaj Ops, sorry. yes you are right.
    but there isn't such file plugin.json both before and after the upgrade. What should I do?
    Thank you very much.

  • Global Moderator Plugin & Theme Dev

    Can you still access the plugins page, or is this error causing the page load to fail entirely?

  • Anime Lovers

    @pitaj
    It doesn't fail loading the page, but just generates error on nodebb log.
    But I also tried following:
    ./nodebb reset -a
    ./nodebb build

    And then remove "nodebb-plugin-require" plugin in "node_modules".
    Then it generates no more error in nodebb log.

    But it then gives this instead:
    warn: [meta/dependencies] Bundled plugin nodebb-plugin-require not found, skipping dependency check.
    warn: [plugins/nodebb-theme-persona] The plugin.json field "library" is deprecated. Please use the package.json field "main" instead.

    And then I installed https://github.com/NodeBB/nodebb-plugin-quickstart
    then it starts warning again
    "error: Error: ENOENT: no such file or directory, open '/home/myid/nodebb/node_modules/nodebb-plugin-require/plugin.json'".

    So, I wondered if nodebb-plugin-quickstart plugin itself only had a problem, so remove all nodebb files and db, then installed original version of v1.16.0 without importing datas from mybb, then installed nodebb-plugin-quickstart, but then it gives no error when entering admin plugin page. Thus I think only upgraded nodebb gets that error.

  • Global Moderator Plugin & Theme Dev

    @noob111 I'm guessing a past plugin you used had nodebb-plugin-require as a dependency, and NodeBB picked it up as a plugin and added it as a dependency in your package.json. The way npm works, it will add any missing dependencies when you run install, so that's why the error turned back up when you install the quickstart plugin.

    You can probably resolve this by removing nodebb-plugin-require from your NodeBB package.json file, deleting node_modules, and running npm i again.

  • Anime Lovers

    @pitaj

    No sorry, that didn't solve. But following worked:

    1. After importing mybb, upgrade it to v1.16.0 which produces "Error: ENOENT: no such file or directory, open '/nodebb/node_modules/nodebb-plugin-require/plugin.json' " as mentioned above.
    2. Back up both database and any image files imported from mybb under public/uploads/files
    3. Delete whole nodebb files and database
    4. Install original v1.16.0 (git clone -b v1.16.x https://github.com/NodeBB/NodeBB.git)
    5. Remove only the database, then restore database and image files using backups
    6. Works well, it doesn't produce any error even after installing quickstart plugin.

    Additionally, https://github.com/NodeBB/nodebb-plugin-quickstart doesn't work on v1.16.0.
    It shows following error on Chrome and the page got frozen while loading:
    colorpicker.js:11 Uncaught TypeError: n.ColorPicker is not a function
    at HTMLInputElement.<anonymous> (colorpicker.js:11)
    at Function.each (jquery.js:381)
    at C.fn.init.each (jquery.js:203)
    at Object.n.enable (colorpicker.js:8)
    at o (admin.js:31)
    at Object.i.init (admin.js:9)
    at ajaxify.js:336
    at Object.execCb (require.js:1696)
    at n.check (require.js:883)
    at n.<anonymous> (require.js:1139)

    Anyways, it's not to be discussed here I guess.
    Thank you very much!

Suggested Topics

  • 8
  • 3
  • 14
  • 4
  • 3
| |