Composer lagging
-
@pichalite said in Composer lagging:
@teh_g yes, coz it's not valid
I promise I know how to read. I did
nodebb upgrade
. I just misread your post. It has been a long day of meetings and not enough coffee.As far as I can tell, everything is upgraded happily. I do see the
./node_modules/screenfull/dist/screenfull.js
file. The only interesting thing is the error in the logs is looking undernode_modules/nodebb-plugin-composer-default/node_modules/screenfull/dist/screenfull.js
-
@pichalite said in Composer lagging:
@teh_g what's your npm version?
$ npm -v 3.10.3 $ node --version v6.3.1
-
@pichalite said in Composer lagging:
@teh_g that's the problem right there... npm v3 installs dependencies in the root node_modules directory. Composer is looking for the file in it's own node_modules directory.
Should I roll back to Node.js 4.x?
-
-
@pichalite said in Composer lagging:
@teh_g blame @pitaj for making you upgrade node.js coz he wrote his calendar plugin with ES6 features even though NodeBB itself doesn't support ES6 yet.
Should I roll back to Node.js 4.x?
I guess so unless there is an alternative.
I used n to set the LTS release as my node version.
$ npm -v 2.15.8 $ node -v v4.4.7
I am still seeing the same error. I did an
npm rb
, but the issue continues. I am still not seeing the screenfull dependency in the Composer folder. -
OK. So I ended up going the wrecking ball route. I moved the existing ./node_modules folder to a backup location, then ran the
npm install --production
command. This rebuilt the node_modules folder for me with the proper dependencies.I do think a warning should be added to the documentation for which versions of node and npm are supported.
-
Same error.
-
Since some others are running into this, here are the full steps I took to resolve this.
Determining if this will fix your issue
- The following error appears in the browser console:
Uncaught ReferenceError: screenfull is not defined
- The following error appears in the NodeBB log:
[minifier] file not found, node_modules/nodebb-plugin-composer-default/node_modules/screenfull/dist/screenfull.js
- The path
/path/to/forums/node_modules/nodebb-plugin-composer-default/node_modules/
does not exist - You are running a more recent version of Node.js (only confirmed this occurs on v6.3.1)
- You are running a more recent version of npm (only confirmed this occurs on v3.10.3
Why is this an issue
@pichalite pointed this out here:npm v3 installs dependencies in the root node_modules directory. Composer is looking for the file in it's own node_modules directory.
How do I fix it?!
- I could not find a "good" method to fix this. So here is what I ended up doing:
# Roll back to the LTS version of Node.js and npm sudo n LTS # Confirm that you are on the proper Node.js version (as of writing this is LTS) $ node --version v4.4.7 $ npm -v 2.15.8 # Stop the forums <whichever method you normally use> # Manually make note of any installed plugins # Move the node_modules folder to a backup location cd /path/to/forums mv ./node_modules ./node_modules_backup # Re-install the NodeBB dependencies npm install --production # Confirm NodeBB upgrade for any additional dependencies (probably not required) ./nodebb upgrade # Install any plugins via npm (can be done manually in the UI as well) # Start the forums
- The following error appears in the browser console:
-
@teh_g or you just not downgrade everything and instead just install screenful directly into the composer directory:
cd node_modules/nodebb_plugin_composer npm i screenful
That should install screenful in
node_modules/nodebb_plugin_composer/node_modules/screenful
Edit: you could also try just downgrading to npm@2 and uninstalling, then reinstalling the composer:
npm i -g npm@2 npm remove nodebb-plugin-composer screenful npm i nodebb-plugin-composer
-
@PitaJ said in Composer lagging:
@teh_g or you just not downgrade everything and instead just install screenful directly into the composer directory:
cd node_modules/nodebb_plugin_composer npm i screenful
That should install screenful in
node_modules/nodebb_plugin_composer/node_modules/screenful
Edit: you could also try just downgrading to npm@2 and uninstalling, then reinstalling the composer:
npm i -g npm@2 npm remove nodebb-plugin-composer screenful npm i nodebb-plugin-composer
Your way definitely sounds easier. I already did the downgrade. It was relatively easy