Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

NodeBB: Difference between revisions

From iFixWiki
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 2: Line 2:


= Issues =
= Issues =
== SyntaxError: Unexpected end of JSON ==
== Can't install nodebb-plugin-mybb-import ==
When trying to setup or upgrade nodeBB sometimes an error pops up that says
When trying to install this plugin either from the nodeBB admin page or the command-line interface (CLI), an error will pop up saying:
 
    $ npm install nodebb-plugin-import
    > iconv@2.3.5 install /var/nodebb/node_modules/iconv
    > node-gyp rebuild
    make: Entering directory '/var/nodebb/node_modules/iconv/build'
      CXX(target) Release/obj.target/iconv/src/binding.o
    make: g++: Command not found
    iconv.target.mk:107: recipe for target 'Release/obj.target/iconv/src/binding.o' failed
    make: *** [Release/obj.target/iconv/src/binding.o] Error 127
    make: Leaving directory '/var/nodebb/node_modules/iconv/build'
    gyp ERR! build error
    gyp ERR! stack Error: `make` failed with exit code: 2
    gyp ERR! stack    at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:191:23)
    gyp ERR! stack    at ChildProcess.emit (events.js:198:13)
    gyp ERR! stack    at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
    gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
    gyp ERR! cwd /var/nodebb/node_modules/iconv
    gyp ERR! node -v v10.23.2
    gyp ERR! node-gyp -v v5.1.0
    gyp ERR! not ok
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! iconv@2.3.5 install: `node-gyp rebuild`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the iconv@2.3.5 install script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
   
'''Solution<ref>https://github.com/bnoordhuis/node-iconv/issues/164#issuecomment-292122618</ref>'''
 
From the CLI, install these dependencies:
    $ apt install g++
    $ npm install node-gyp
    $ npm install iconv
 
== SyntaxError: Unexpected string in JSON ==
 
When attempting to upgrade nodebb using ./nodebb upgrade the following error occurs:


''SyntaxError: Unexpected end of JSON input while parsing near '...party/-/connect-multi'''
    undefined:17
      "main": "theme.less",
      ^
    SyntaxError: Unexpected string in JSON at position 393


'''Solution<ref>https://community.nodebb.org/post/78112</ref>'''
'''Solution'''


Run the command:
Run the command:


npm cache clean --force
  npm update
 
NodeBB is a forum software that's modern, fast, and efficient. In contrast to most forums which use PHP, NodeBB leverages Node.js and JavaScript to create a high performance website.


= Issues =
== SyntaxError: Unexpected end of JSON  ==
== SyntaxError: Unexpected end of JSON  ==
When trying to setup or upgrade nodeBB sometimes an error pops up that says  
When trying to setup or upgrade nodeBB sometimes an error pops up that says  
Line 44: Line 82:


[[Category: Website Software]]
[[Category: Website Software]]
= References =
[[Category: Website Software]]]

Latest revision as of 04:18, 8 June 2022

NodeBB is a forum software that's modern, fast, and efficient. In contrast to most forums which use PHP, NodeBB leverages Node.js and JavaScript to create a high performance website.

Issues[edit]

Can't install nodebb-plugin-mybb-import[edit]

When trying to install this plugin either from the nodeBB admin page or the command-line interface (CLI), an error will pop up saying:

   $ npm install nodebb-plugin-import
   > iconv@2.3.5 install /var/nodebb/node_modules/iconv
   > node-gyp rebuild
   make: Entering directory '/var/nodebb/node_modules/iconv/build'
     CXX(target) Release/obj.target/iconv/src/binding.o
   make: g++: Command not found
   iconv.target.mk:107: recipe for target 'Release/obj.target/iconv/src/binding.o' failed
   make: *** [Release/obj.target/iconv/src/binding.o] Error 127
   make: Leaving directory '/var/nodebb/node_modules/iconv/build'
   gyp ERR! build error
   gyp ERR! stack Error: `make` failed with exit code: 2
   gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:191:23)
   gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
   gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
   gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
   gyp ERR! cwd /var/nodebb/node_modules/iconv
   gyp ERR! node -v v10.23.2
   gyp ERR! node-gyp -v v5.1.0
   gyp ERR! not ok
   npm ERR! code ELIFECYCLE
   npm ERR! errno 1
   npm ERR! iconv@2.3.5 install: `node-gyp rebuild`
   npm ERR! Exit status 1
   npm ERR!
   npm ERR! Failed at the iconv@2.3.5 install script.
   npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
   

Solution[1]

From the CLI, install these dependencies:

   $ apt install g++
   $ npm install node-gyp
   $ npm install iconv

SyntaxError: Unexpected string in JSON[edit]

When attempting to upgrade nodebb using ./nodebb upgrade the following error occurs:

   undefined:17
     "main": "theme.less",
     ^
   SyntaxError: Unexpected string in JSON at position 393

Solution

Run the command:

  npm update

SyntaxError: Unexpected end of JSON[edit]

When trying to setup or upgrade nodeBB sometimes an error pops up that says

  SyntaxError: Unexpected end of JSON input while parsing near '...party/-/connect-multi'

Solution[2]

Run the command:

  npm cache clean --force

TypeError: shim$1.Parser.looksLikeNumber is not a function nodebb[edit]

After upgrading nodeBB, sometimes an error appears that says

    nodebb/node_modules/yargs/build/index.cjs:2804
              if (shim$1.Parser.looksLikeNumber(arg) &&
                         ^
                       TypeError: shim$1.Parser.looksLikeNumber is not a function

Solution

Update the npm dependencies by running the command

  npm update

References[edit]