Could not load module 'highlightjs' - phoenix-framework

I installed a module using npm:
npm install highlightjs --save
Then I imported it inside my app.js:
import "highlightjs"
When I run mix phoenix.server, I get this error in the console:
error: Resolving deps of web/static/js/app.js failed. Could not load module 'highlightjs' from '/Users/[path]/web/static/js'. Possible solution: run npm install.
Obviously, running npm install doesn't fix it, since it's already installed.
Versions:
Brunch: 2.7.4
Phoenix: 1.2.1

Related

Npm generate error when installing module

This is error
npm WARN bootstrap#4.0.0-beta.2 requires a peer of popper.js#^1.12.3 but none is installed. You must install peer dependencies yourself.
How can I solve this error?
Peer dependencies are NO LONGER INSTALLED AUTOMATICALLY from version 3.0
https://github.com/npm/npm/releases/tag/v3.0.0
You have to install it manually and make it part of your npm package.
npm install popper.js#^1.12.3 --save

NPM run watch resulting in error Laravel 5.7

I am receiving this error when I try to run npm run watch
Error: Cannot find module 'C:\wamp64\www\node_modules\laravel-mix\setup\webpack.config.js'
I am currently using
Laravel Framework 5.7.16
NPM 6.4.1
Thank you in advance
Edit: yes, I have run npm install
You have to first install your node modules with:
npm install
It seems that you don't have the package Laravel-mix, install it running:
npm install laravel-mix --save-dev
Also check if you have your webpack.config.js inside the main folder of your app, if not check for the docs on how to get it: https://laravel-mix.com/docs/3.0/installation

Gulp global install doesn't work on Windows 7

I am trying to install Gulp globally on a Windows 7 PC. In a command prompt I ran npm install gulp -gand it ran without any errors, although it did return the following warnings:
npm WARN install Couldn't install optional dependency: Failed to parse json
npm WARN install No data, empty input at 1:1
npm WARN install
npm WARN install ^
When I try to run gulp it says it is not recognized as an internal command.
If I check the %AppData%/npm directory, gulp.cmd is not there. Looking at all the answers to gulp command not found - error after installing gulp, I take it this is where it should be.
Any ideas what has gone wrong, or where I can look to see what has gone wrong?
When I tried to do a local install of gulp: npm install gulp, it actually showed an error:
Failed to Parse json... File:
C:\Users\username|AppData\Roaming\npm-cache\clone\1.0.2\package\package.json
When I deleted this file and retried the Global install, it then worked.

bangular: Error: `libsass` bindings not found. Try reinstalling `node-sass`?

I'm getting this error while doing gulp build task after installing "bangular" project (yo bangular).
Error: libsass bindings not found. Try reinstalling node-sass?
seems like this is because of the latest node, python versions
To resolve this:
I have pointed the environment variable PYTHON to python27 binary
npm uninstall node-sass
npm install node-sass#latest
npm uninstall gulp-sass
npm install gulp-sass#latest
also, deleted global node-gyp module (from /nodejs/node_modules/npm/node_modules/ dir) and re-installed (npm install -g node-gyp#latest).

Installing docpad#6.63 error: No compatible version found: taskgroup#'~3.3.7n'

I'm trying to install docpad and following the guide on: http://docpad.org/docs/install
When I issue the command:
npm install -g docpad#6.63
I get the following npm error:
npm ERR! Error: No compatible version found: taskgroup#'~3.3.7n'
npm ERR! Valid install targets:
npm ERR! ["2.0.0","3.0.0","3.1.0","3.1.1","3.1.2","3.2.0","3.2.2","3.2.3","3.2.4","3.3.0","3.3.1","3.3.2","3.3.3","3.3.4","3.3.5","3.3.6","3.3.7","3.3.8"]
My node version: v0.10.15
My npm version: 1.2.18
I'm running Kubuntu 13.10 with all updates.
I checked if there is an issue reported for this on github, there isn't. Should I report this as an issue or am I doing something wrong?
Same problem here (Kubuntu 13.10).
I sugggest to go back to a previous version of docpad for the moment. On Ubunto/Debian there is another pitfall: some node modules depend on the nodejs executable to be available under node, so you need the additional package nodejs-legacy.
This worked for me:
sudo apt-get install nodejs-legacy
npm install docpad#6.55.6
Bug on DocPad's behalf, that n shouldn't have been there. Now fixed in v6.63.5. Thanks for the report!

Resources