node_modules missing after local gulp install - javascript

I ran into an issue today mid-class. I was showing my class how to install and use gulp.js, so I had to show the process on a projector.
I've installed node.js and gulp.js globally with npm install -g gulp and it all works fine.
But when I try to install gulp locally in the project folder I am working on, it looks like gulp is installed, but the node_modules folder is never created.
I tried refreshing, I tried running the command prompt as admin, I've checked for hidden folders, nothing works. --- I even restarted and tried again, cause Windows.
I am working on windows 10.
Transcript of command line output:
C:\Xampp\htdocs\test> node -v
v4.2.4
C:\Xampp\htdocs\test> npm -v
2.14.12
C:\Xampp\htdocs\test> gulp -v
[16:40:28] CLI version 3.9.1
[16:40:28] Local version 3.9.1
C:\Xampp\htdocs\test> npm install --save-dev gulp
npm WARN deprecated minimatch#2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch#0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs#1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs#^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
gulp#3.9.1 ..\..\..\node_modules\gulp
├── interpret#1.0.1
├── pretty-hrtime#1.0.3
├── deprecated#0.0.1
├── archy#1.0.0
├── minimist#1.2.0
├── tildify#1.2.0 (os-homedir#1.0.2)
├── semver#4.3.6
├── v8flags#2.0.11 (user-home#1.1.1)
├── chalk#1.1.3 (escape-string-regexp#1.0.5, supports-color#2.0.0, ansi-styles#2.2.1, strip-ansi#3.0.1, has-ansi#2.0.0)
├── orchestrator#0.3.8 (stream-consume#0.1.0, sequencify#0.0.7, end-of-stream#0.1.5)
├── gulp-util#3.0.8 (array-differ#1.0.0, lodash._reescape#3.0.0, beeper#1.1.1, lodash._reevaluate#3.0.0, array-uniq#1.0.3, object-assign#3.0.0, lodash._reinterpolate#3.0.0, dateformat#2.0.0, replace-ext#0.0.1, has-gulplog#0.1.0, fancy-log#1.3.0, vinyl#0.5.3, gulplog#1.0.0, lodash.template#3.6.2, through2#2.0.3, multipipe#0.1.2)
├── vinyl-fs#0.3.14 (strip-bom#1.0.0, vinyl#0.4.6, defaults#1.0.3, graceful-fs#3.0.11, through2#0.6.5, mkdirp#0.5.1, glob-stream#3.1.18, glob-watcher#0.0.6)
└── liftoff#2.3.0 (lodash.isstring#4.0.1, lodash.isplainobject#4.0.6, lodash.mapvalues#4.6.0, extend#3.0.0, rechoir#0.6.2, flagged-respawn#0.3.2, resolve#1.2.0, fined#1.0.2, findup-sync#0.4.3)
Note: npm is in my PATH.

You need either package.json or folder named node_modules in the current directory. If you are not going to have one, npm will look for either one in the parent directories. Check answer to NPM Installs Package Outside Current Directory for more details.
Also it is advised to start with npm init which will create package.json for you.

Related

How to run this html-minifier from the command-line on Ubuntu?

I'm trying to run this HTML minifier from an Ubuntu command-line.
But I'm getting an error when I try to do so.
NodeJS and NPM installs fine:
root$ apt-get install -y nodejs npm
Reading package lists... Done
Building dependency tree
Reading state information... Done
nodejs is already the newest version.
npm is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Installing the html-minifier seems to work:
root$ npm install html-minifier -g
npm http GET https://registry.npmjs.org/html-minifier
<... SNIP ...>
npm http 304 https://registry.npmjs.org/source-map
/usr/local/bin/html-minifier -> /usr/local/lib/node_modules/html-minifier/cli.js
html-minifier#3.5.9 /usr/local/lib/node_modules/html-minifier
├── commander#2.14.1
├── ncname#1.0.0 (xml-char-classes#1.0.0)
├── relateurl#0.2.7
├── he#1.1.1
├── param-case#2.1.1 (no-case#2.3.2)
├── camel-case#3.0.0 (upper-case#1.1.3, no-case#2.3.2)
├── clean-css#4.1.9 (source-map#0.5.7)
└── uglify-js#3.3.12 (source-map#0.6.1)
I can see that the html-minifier is installed:
root$ which html-minifier
/usr/local/bin/html-minifier
root$ head -5 /usr/local/bin/html-minifier
#!/usr/bin/env node
/**
* html-minifier CLI tool
*
* The MIT License (MIT)
But when I try to run it, I get the following error:
root$ html-minifier
/usr/bin/env: node: No such file or directory
Why can't I run the html-minifier? What am I doing wrong? And how can I fix it??
On ubuntu, node is called nodejs. Two options I can see
Edit the file "/usr/local/bin/html-minifier" and change #!/usr/bin/env node to #!/usr/bin/env nodejs
Add a small script node to start nodejs for you, or try alias node=nodejs

How to manage different versions of node.js in same operating system?

I have installed node.js v8.6.0 and i'm trying to run v.4.4.3 developed npm module. It created problem like this:
$ yo angular-scalatra
+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+
|a|n|g|u|l|a|r| |s|c|a|l|a|t|r|a| |g|e|n|e|r|a|t|o|r|
+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+
[?] What is the name of your application? myapp
[?] What is your default package name? com.mycompany.myapp
create generator.json
create package.json
create bower.json
identical .bowerrc
create Gruntfile.js
identical .gitignore
create sbt
create assembly.sbt
create project/build.properties
create project/build.scala
create project/plugins.sbt
create src/main/resources/logback.xml
create src/main/scala/JettyLauncher.scala
create src/main/scala/ScalatraBootstrap.scala
create src/main/scala/com/mycompany/myapp/data/DatabaseInit.scala
create src/main/scala/com/mycompany/myapp/json/DateSerializer.scala
create src/main/scala/com/mycompany/myapp/data/DatabaseSessionSupport.scala
create src/main/scala/com/mycompany/myapp/models/ScalatraRecord.scala
create src/main/webapp/WEB-INF/web.xml
create src/main/webapp/index.html
create src/main/webapp/css/app.css
create src/main/webapp/js/app.js
create src/main/webapp/js/home/home-controller.js
create src/main/webapp/views/home/home.html
identical .editorconfig
identical .jshintrc
I'm all done. Running bower install & npm install for you to install the required dependencies. If this fails, try running the command yourself.
npm WARN deprecated grunt-ngmin#0.0.3: use grunt-ng-annotate instead
npm WARN deprecated bower#1.2.8: ...psst! Your project can stop working at any moment because its dependencies can change. Prevent this by migrating to Yarn: https://bower.io/blog/2017/how-to-migrate-away-from-bower/
npm WARN deprecated connect#2.7.11: connect 2.x series is deprecated
npm WARN deprecated minimatch#0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated ngmin#0.4.1: use ng-annotate instead
npm WARN deprecated graceful-fs#2.0.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs#^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated graceful-fs#1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs#^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated connect#2.8.8: connect 2.x series is deprecated
npm WARN deprecated minimatch#0.4.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated node-uuid#1.4.8: Use uuid module instead
npm WARN deprecated minimatch#0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated find-file#0.1.4: Use the globby package instead
> ws#0.4.32 install /home/limitless/Documents/projects/test/scala/myapp/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory '/home/limitless/Documents/projects/test/scala/myapp/node_modules/ws/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
bufferutil.target.mk:97: recipe for target 'Release/obj.target/bufferutil/src/bufferutil.o' failed
make: Leaving directory '/home/limitless/Documents/projects/test/scala/myapp/node_modules/ws/build'
> gifsicle#0.1.7 postinstall /home/limitless/Documents/projects/test/scala/myapp/node_modules/gifsicle
> node index.js
path.js:28
throw new TypeError('Path must be a string. Received ' + inspect(path));
^
TypeError: Path must be a string. Received { url: 'https://raw.github.com/imagemin/gifsicle-bin/v0.1.7/vendor/linux/x64/gifsicle',
name: 'gifsicle',
os: 'linux',
arch: 'x64' }
at assertPath (path.js:28:11)
at Object.basename (path.js:1397:5)
at /home/limitless/Documents/projects/test/scala/myapp/node_modules/download/index.js:35:43
at each (/home/limitless/Documents/projects/test/scala/myapp/node_modules/each-async/each-async.js:63:4)
at module.exports (/home/limitless/Documents/projects/test/scala/myapp/node_modules/download/index.js:33:5)
at /home/limitless/Documents/projects/test/scala/myapp/node_modules/bin-wrapper/index.js:108:20
at /home/limitless/Documents/projects/test/scala/myapp/node_modules/bin-wrapper/index.js:141:24
at /home/limitless/Documents/projects/test/scala/myapp/node_modules/bin-check/index.js:30:20
at /home/limitless/Documents/projects/test/scala/myapp/node_modules/executable/index.js:39:20
at FSReqWrap.oncomplete (fs.js:153:21)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#github:pipobscure/fsevents#7dcdf9fa3f8956610fd6f69f72c67bace2de7138 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#0.2.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN karma#0.10.10 requires a peer of karma-requirejs#~0.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN karma#0.10.10 requires a peer of karma-coffee-preprocessor#~0.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN karma#0.10.10 requires a peer of karma-html2js-preprocessor#~0.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN karma#0.10.10 requires a peer of karma-chrome-launcher#~0.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN karma#0.10.10 requires a peer of karma-firefox-launcher#~0.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN karma#0.10.10 requires a peer of karma-phantomjs-launcher#~0.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN karma#0.10.10 requires a peer of karma-script-launcher#~0.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN myapp#0.0.0 No repository field.
npm WARN myapp#0.0.0 No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gifsicle#0.1.7 postinstall: `node index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the gifsicle#0.1.7 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/limitless/.npm/_logs/2017-10-16T16_19_21_976Z-debug.log
So i'm not able to run application. Can you help me to resolve this problem?
the solution is n first install typing
npm install -g n
and then install with
sudo n 4.4.3
this install will set your node js version to use in the system
The error message says that "Path must be a string", and shows that the path it received is an object, not a string.
Perhaps you should be using path.url instead of path?
(Just guessing. You should show the relevant code when you ask these types of questions.)
I resolved issue installation of nvm(Node Version Manager) and V4.4.3 node.js
1) To install nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.5/install.sh | bash
2) if installation is done then open new terminal and list what version of node installed.
nvm ls
nvm ls
-> system
node -> stable (-> N/A) (default)
iojs -> N/A (default)
3) Install node.js which version you want ex.V4.4.3
nvm install v4.4.3
4) set default version of node.js
nvm alias default v4.4.3
5) run your application
$ yo angular-scalatra
+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+
|a|n|g|u|l|a|r| |s|c|a|l|a|t|r|a| |g|e|n|e|r|a|t|o|r|
+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+
[?] What is the name of your application? myapp
[?] What is your default package name? com.mycompany.myapp
create generator.json
create package.json
create bower.json
identical .bowerrc
create Gruntfile.js
identical .gitignore
create sbt
create assembly.sbt
create project/build.properties
create project/build.scala
create project/plugins.sbt
create src/main/resources/logback.xml
create src/main/scala/JettyLauncher.scala
create src/main/scala/ScalatraBootstrap.scala
create src/main/scala/com/mycompany/myapp/data/DatabaseInit.scala
create src/main/scala/com/mycompany/myapp/json/DateSerializer.scala
create src/main/scala/com/mycompany/myapp/data/DatabaseSessionSupport.scala
create src/main/scala/com/mycompany/myapp/models/ScalatraRecord.scala
create src/main/webapp/WEB-INF/web.xml
create src/main/webapp/index.html
create src/main/webapp/css/app.css
create src/main/webapp/js/app.js
create src/main/webapp/js/home/home-controller.js
create src/main/webapp/views/home/home.html
identical .editorconfig
identical .jshintrc
I'm all done. Running bower install & npm install for you to install the required dependencies. If this fails, try running the command yourself.
npm WARN package.json myapp#0.0.0 No repository field.
npm WARN package.json myapp#0.0.0 No README data
npm WARN package.json myapp#0.0.0 No license field.
npm WARN deprecated grunt-ngmin#0.0.3: use grunt-ng-annotate instead
npm WARN engine karma#0.10.10: wanted: {"node":"~0.8 || ~0.10"} (current: {"node":"4.4.3","npm":"2.15.1"})
npm WARN deprecated ngmin#0.4.1: use ng-annotate instead
npm WARN deprecated bower#1.2.8: ...psst! Your project can stop working at any moment because its dependencies can change. Prevent this by migrating to Yarn: https://bower.io/blog/2017/how-to-migrate-away-from-bower/
npm WARN deprecated connect#2.7.11: connect 2.x series is deprecated
npm WARN deprecated minimatch#0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN peerDependencies The peer dependency karma-requirejs#~0.2.0 included from karma will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency karma-coffee-preprocessor#~0.1.0 included from karma will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency karma-html2js-preprocessor#~0.1.0 included from karma will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency karma-chrome-launcher#~0.1.0 included from karma will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency karma-firefox-launcher#~0.1.0 included from karma will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency karma-phantomjs-launcher#~0.1.0 included from karma will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency karma-script-launcher#~0.1.0 included from karma will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN deprecated connect#2.8.8: connect 2.x series is deprecated
npm WARN deprecated graceful-fs#1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs#^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated find-file#0.1.4: Use the globby package instead
npm WARN deprecated minimatch#0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs#2.0.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs#^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated minimatch#0.4.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
> grunt-autoprefixer#0.4.2 postinstall /home/limitless/Documents/projects/test/scala/myapp/node_modules/grunt-autoprefixer
>
npm WARN engine hawk#6.0.2: wanted: {"node":">=4.5.0"} (current: {"node":"4.4.3","npm":"2.15.1"})
npm WARN engine hawk#6.0.2: wanted: {"node":">=4.5.0"} (current: {"node":"4.4.3","npm":"2.15.1"})
npm WARN engine hawk#6.0.2: wanted: {"node":">=4.5.0"} (current: {"node":"4.4.3","npm":"2.15.1"})
npm WARN engine hawk#6.0.2: wanted: {"node":">=4.5.0"} (current: {"node":"4.4.3","npm":"2.15.1"})
npm WARN engine hawk#6.0.2: wanted: {"node":">=4.5.0"} (current: {"node":"4.4.3","npm":"2.15.1"})
npm WARN engine hawk#6.0.2: wanted: {"node":">=4.5.0"} (current: {"node":"4.4.3","npm":"2.15.1"})
npm WARN engine hawk#6.0.2: wanted: {"node":">=4.5.0"} (current: {"node":"4.4.3","npm":"2.15.1"})
npm WARN engine hawk#6.0.2: wanted: {"node":">=4.5.0"} (current: {"node":"4.4.3","npm":"2.15.1"})
npm WARN optional dep failed, continuing fsevents#0.2.1
npm WARN deprecated node-uuid#1.4.8: Use uuid module instead
> pngquant-bin#0.1.7 postinstall /home/limitless/Documents/projects/test/scala/myapp/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin
> node index.js
✓ pre-build test passed successfully
> optipng-bin#0.3.11 postinstall /home/limitless/Documents/projects/test/scala/myapp/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin
> node index.js
✔ pre-build test passed successfully!
> jpegtran-bin#0.2.8 postinstall /home/limitless/Documents/projects/test/scala/myapp/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin
> node index.js
✔ pre-build test passed successfully!
> gifsicle#0.1.7 postinstall /home/limitless/Documents/projects/test/scala/myapp/node_modules/grunt-contrib-imagemin/node_modules/gifsicle
> node index.js
✔ pre-build test passed successfully!
> ws#0.4.32 install /home/limitless/Documents/projects/test/scala/myapp/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory '/home/limitless/Documents/projects/test/scala/myapp/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
bufferutil.target.mk:92: recipe for target 'Release/obj.target/bufferutil/src/bufferutil.o' failed
make: Leaving directory '/home/limitless/Documents/projects/test/scala/myapp/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build'
npm WARN peerDependencies The peer dependency requirejs#^2.1.0 included from karma-requirejs will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN deprecated tough-cookie#2.2.2: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
/
> phantomjs#1.9.20 install /home/limitless/Documents/projects/test/scala/myapp/node_modules/karma-phantomjs-launcher/node_modules/phantomjs
> node install.js
PhantomJS not found on PATH
Downloading https://github.com/Medium/phantomjs/releases/download/v1.9.19/phantomjs-1.9.8-linux-x86_64.tar.bz2
Saving to /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2
Receiving...
[========================================] 99%
Received 12854K total.
Extracting tar contents (via spawned process)
Removing /home/limitless/Documents/projects/test/scala/myapp/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom
Copying extracted folder /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2-extract-1508170953450/phantomjs-1.9.8-linux-x86_64 -> /home/limitless/Documents/projects/test/scala/myapp/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom
Writing location.js file
Done. Phantomjs binary available at /home/limitless/Documents/projects/test/scala/myapp/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/bin/phantomjs
karma-jasmine#0.1.6 node_modules/karma-jasmine
grunt-rev#0.1.0 node_modules/grunt-rev
karma-ng-scenario#0.1.0 node_modules/karma-ng-scenario
grunt-contrib-concat#0.3.0 node_modules/grunt-contrib-concat
grunt-contrib-copy#0.4.1 node_modules/grunt-contrib-copy
karma-junit-reporter#0.1.0 node_modules/karma-junit-reporter
└── xmlbuilder#0.4.2
grunt-contrib-clean#0.5.0 node_modules/grunt-contrib-clean
└── rimraf#2.2.8
grunt-sync#0.0.8 node_modules/grunt-sync
└── promised-io#0.3.3
grunt-concurrent#0.4.3 node_modules/grunt-concurrent
├── lpad#0.1.0
└── async#0.2.10
time-grunt#0.2.3 node_modules/time-grunt
├── ms#0.6.2
├── hooker#0.2.3
├── text-table#0.2.0
└── chalk#0.3.0 (has-color#0.1.7, ansi-styles#0.2.0)
grunt-contrib-htmlmin#0.1.3 node_modules/grunt-contrib-htmlmin
├── html-minifier#0.5.6
└── grunt-lib-contrib#0.6.1 (zlib-browserify#0.0.1)
grunt-connect-proxy#0.2.0 node_modules/grunt-connect-proxy
├── lodash#0.9.2
└── http-proxy#1.11.3 (eventemitter3#1.2.0, requires-port#0.0.1)
grunt-contrib-cssmin#0.7.0 node_modules/grunt-contrib-cssmin
├── grunt-lib-contrib#0.6.1 (zlib-browserify#0.0.1)
└── clean-css#2.0.8 (commander#2.0.0)
grunt-karma#0.6.2 node_modules/grunt-karma
└── optimist#0.6.1 (wordwrap#0.0.3, minimist#0.0.10)
grunt-usemin#2.0.2 node_modules/grunt-usemin
├── debug#0.7.4
└── lodash#1.0.2
load-grunt-tasks#0.2.1 node_modules/load-grunt-tasks
├── globule#0.1.0 (lodash#1.0.2, glob#3.1.21, minimatch#0.2.14)
└── findup-sync#0.1.3 (lodash#2.4.2, glob#3.2.11)
grunt-svgmin#0.3.1 node_modules/grunt-svgmin
├── each-async#0.1.3
├── pretty-bytes#0.1.2
├── chalk#0.4.0 (has-color#0.1.7, ansi-styles#1.0.0, strip-ansi#0.1.1)
└── svgo#0.4.5 (colors#0.6.2, whet.extend#0.9.9, sax#0.6.1, coa#0.4.1, js-yaml#2.1.3)
grunt-autoprefixer#0.4.2 node_modules/grunt-autoprefixer
└── autoprefixer#0.8.20131213 (css-parse#1.6.0, css-stringify#1.4.1)
grunt-contrib-connect#0.5.0 node_modules/grunt-contrib-connect
├── connect-livereload#0.2.0
├── open#0.0.4
└── connect#2.7.11 (fresh#0.1.0, qs#0.6.5, pause#0.0.1, cookie-signature#1.0.1, buffer-crc32#0.2.1, bytes#0.2.0, cookie#0.0.5, formidable#1.0.14, debug#3.1.0, send#0.1.1)
grunt-contrib-watch#0.5.3 node_modules/grunt-contrib-watch
├── gaze#0.4.3 (globule#0.1.0)
└── tiny-lr#0.0.4 (debug#0.7.4, qs#0.5.6, faye-websocket#0.4.4, noptify#0.0.3)
grunt-bower-install#0.7.0 node_modules/grunt-bower-install
└── wiredep#0.4.2 (chalk#0.1.1, lodash#1.3.1)
grunt-contrib-uglify#0.2.7 node_modules/grunt-contrib-uglify
├── grunt-lib-contrib#0.6.1 (zlib-browserify#0.0.1)
└── uglify-js#2.4.24 (async#0.2.10, uglify-to-browserify#1.0.2, yargs#3.5.4, source-map#0.1.34)
grunt-ngmin#0.0.3 node_modules/grunt-ngmin
└── ngmin#0.4.1 (astral#0.1.0, clone#0.1.19, esprima#1.0.4, commander#1.1.1, astral-angular-annotate#0.0.2, escodegen#0.0.28)
grunt-contrib-jshint#0.7.2 node_modules/grunt-contrib-jshint
└── jshint#2.3.0 (console-browserify#0.1.6, underscore#1.4.4, minimatch#0.4.0, shelljs#0.1.4, cli#0.4.5)
grunt#0.4.5 node_modules/grunt
├── eventemitter2#0.4.14
├── dateformat#1.0.2-1.2.3
├── which#1.0.9
├── getobject#0.1.0
├── async#0.1.22
├── colors#0.6.2
├── lodash#0.9.2
├── rimraf#2.2.8
├── hooker#0.2.3
├── grunt-legacy-util#0.2.0
├── exit#0.1.2
├── nopt#1.0.10 (abbrev#1.1.1)
├── coffee-script#1.3.3
├── iconv-lite#0.2.11
├── underscore.string#2.2.1
├── glob#3.1.21 (inherits#1.0.2, graceful-fs#1.2.3)
├── minimatch#0.2.14 (sigmund#1.0.1, lru-cache#2.7.3)
├── grunt-legacy-log#0.1.3 (grunt-legacy-log-utils#0.1.1, lodash#2.4.2, underscore.string#2.3.3)
├── findup-sync#0.1.3 (lodash#2.4.2, glob#3.2.11)
└── js-yaml#2.0.5 (esprima#1.0.4, argparse#0.1.16)
grunt-modernizr#0.4.1 node_modules/grunt-modernizr
├── colors#0.6.2
├── promised-io#0.3.5
├── uglify-js#1.3.3
└── request#2.27.0 (aws-sign#0.3.0, forever-agent#0.5.2, tunnel-agent#0.3.0, qs#0.6.6, oauth-sign#0.3.0, mime#1.2.11, json-stringify-safe#5.0.1, cookie-jar#0.3.0, node-uuid#1.4.8, http-signature#0.10.1, hawk#1.0.0, form-data#0.1.4)
grunt-bowercopy#0.4.1 node_modules/grunt-bowercopy
├── lodash#2.4.2
└── bower#1.2.8 (stringify-object#0.1.8, junk#0.2.2, abbrev#1.0.9, which#1.0.9, osenv#0.0.3, graceful-fs#2.0.3, open#0.0.5, nopt#2.1.2, bower-endpoint-parser#0.2.2, chmodr#0.1.2, bower-logger#0.2.2, archy#0.0.2, p-throttler#0.0.1, q#0.9.7, rimraf#2.2.8, lru-cache#2.3.1, retry#0.6.1, semver#2.1.0, chalk#0.2.1, mkdirp#0.3.5, tmp#0.0.33, sudo-block#0.2.1, request-progress#0.3.1, bower-json#0.4.0, glob#3.2.11, fstream-ignore#0.0.10, tar#0.1.20, promptly#0.2.1, fstream#0.1.31, cardinal#0.4.4, request#2.27.0, decompress-zip#0.0.8, handlebars#1.0.12, inquirer#0.3.5, mout#0.7.1, bower-config#0.5.3, update-notifier#0.1.10, bower-registry-client#0.1.6)
grunt-contrib-imagemin#0.4.1 node_modules/grunt-contrib-imagemin
├── filesize#2.0.4
├── async#0.2.10
├── chalk#0.4.0 (has-color#0.1.7, ansi-styles#1.0.0, strip-ansi#0.1.1)
├── pngquant-bin#0.1.7 (bin-wrapper#0.2.4)
├── optipng-bin#0.3.11 (log-symbols#1.0.2, bin-wrapper#0.3.4, bin-build#0.1.1)
├── jpegtran-bin#0.2.8 (log-symbols#1.0.2, bin-wrapper#0.3.4, bin-build#0.1.1)
└── gifsicle#0.1.7 (log-symbols#1.0.2, bin-wrapper#0.3.4, bin-build#0.1.1)
karma-script-launcher#0.1.0 node_modules/karma-script-launcher
karma-firefox-launcher#0.1.7 node_modules/karma-firefox-launcher
karma-html2js-preprocessor#0.1.0 node_modules/karma-html2js-preprocessor
karma-chrome-launcher#0.1.12 node_modules/karma-chrome-launcher
└── which#1.3.0 (isexe#2.0.0)
karma-coffee-preprocessor#0.1.3 node_modules/karma-coffee-preprocessor
└── coffee-script#1.7.1 (mkdirp#0.3.5)
requirejs#2.3.5 node_modules/requirejs
karma-requirejs#0.2.6 node_modules/karma-requirejs
karma-phantomjs-launcher#0.1.4 node_modules/karma-phantomjs-launcher
└── phantomjs#1.9.20 (progress#1.1.8, kew#0.7.0, which#1.2.14, request-progress#2.0.1, hasha#2.2.0, extract-zip#1.5.0, fs-extra#0.26.7, request#2.67.0)
karma#0.10.10 node_modules/karma
├── colors#0.6.0-1
├── di#0.0.1
├── graceful-fs#1.2.3
├── mime#1.2.11
├── rimraf#2.1.4
├── q#0.9.7
├── lodash#1.1.1
├── coffee-script#1.6.3
├── minimatch#0.2.14 (sigmund#1.0.1, lru-cache#2.7.3)
├── glob#3.1.21 (inherits#1.0.2)
├── optimist#0.3.7 (wordwrap#0.0.3)
├── useragent#2.0.10 (lru-cache#2.2.4)
├── log4js#0.6.38 (semver#4.3.6, readable-stream#1.0.34)
├── chokidar#0.8.4 (recursive-readdir#0.0.2)
├── connect#2.8.8 (methods#0.0.1, uid2#0.0.2, qs#0.6.5, cookie-signature#1.0.1, pause#0.0.1, buffer-crc32#0.2.1, bytes#0.2.0, fresh#0.2.0, cookie#0.1.0, send#0.1.4, debug#3.1.0, formidable#1.0.14)
├── http-proxy#0.10.4 (colors#0.6.2, pkginfo#0.3.1, optimist#0.6.1, utile#0.2.1)
└── socket.io#0.9.19 (base64id#0.1.0, policyfile#0.0.4, redis#0.7.3, socket.io-client#0.9.16)

UNMET PEER DEPENDENCY with react

I'm having javascript problems related to react. This is the error caught by chrome when page is rendering:
Uncaught TypeError: Super expression must either be null or a function, not undefined
at _inherits (application.js:16301)
at application.js:16310
at Object.232.prop-types (application.js:16549)
at s (application.js:1)
at application.js:1
at Object.233../Collapse (application.js:16574)
at s (application.js:1)
at application.js:1
at Object.1.react (application.js:78)
at s (application.js:1)
When I've install my react using npm it complains about peer dependencies of react and react-height:
├─┬ UNMET PEER DEPENDENCY react#0.14.9
│ ├─┬ envify#3.4.1
│ │ └─┬ jstransform#11.0.3
│ │ ├── base62#1.1.2
│ │ ├─┬ commoner#0.10.8
│ │ │ ├─┬ commander#2.9.0
...
And:
├─┬ UNMET PEER DEPENDENCY react-height#2.2.1
│ └─┬ create-react-class#15.5.2
│ └─┬ fbjs#0.8.12
│ └── core-js#1.2.7
After that I changed my package.json file to:
"react": "0.14.9",
"react-bootstrap": "^0.28.1",
"react-collapse": "^2.2.1",
"react-dom": "^0.14.3",
"react-height": "2.2.1",
...
After these changes I removed completely node_modules folder with rm -rf did an npm cache clean and reinstall again.
The VERY SAME problem continues to occur. I notice 2 warnings:
npm WARN react-collapse#2.4.0 requires a peer of react#>=15.3 but none was installed.
npm WARN react-collapse#2.4.0 requires a peer of react-height#^3 but none was installed.
Is there a problem to update the packages or a problem related to react itself?
Your react version doesn't meet react-collapse requirements. It doesn't really mean that both packages can't work together, just try it and if everything works as intended.
But if you need to fix that you have two ways of doing that:
First way
Delete "react": "0.14.9", line, and run npm i --save react. NPM will install latest react package. Error should be fixed.
Second way
If you really need to use 0.14.9 version you should find react-collapse version which is compatible with your reactjs version.
To do so type in your console npm show react-collapse versions - an array of records will show up.
Now we have to pick one earlier version and check the peerDependencies
of our selected package.
We use npm view react-collapse#3.0.0 command, the result will be
Because we selected #3.0.0 version which is ok in our case, we need to install it. Following command will do the work npm install --save react-collapse#3.0.0.
UPDATE
If above solution does not work. Please install missing peerDependencies manually via npm i --save <package-name>.
Explaination:
Check your npm version doing npm -v. If your version is > 3 then it means peer dependencies must be installed manually. I guess that is the case, version 3.0.0 was released in mid 2015.
The automatic install of peer dependencies was explicitly removed with
npm 3, as it cause more problems than it tried to solve.
Please read official npm changelog, you are looking for section "breaking changes".
There is CLI tool which installs an NPM package and its peer dependencies automatically. You might be interested in.
Make sure you have a package.lock.json file in your directory. React uses yarn command, instead of trying npm install try doing yarn add <package name>
I had the same peer dependency error during netlify build and deploy with my react-elastic-carousel and the only thing that solved it was.
yarn add react-elastic-carousel
Hope it helps!

How do I properly include a pull request on github into my build of React-Native-Web?

I am trying to make use of React-Native-Web, but the master branch version of ListView gives the error: TypeError: undefined is not a constructor (evaluating 'new _reactNative.ListView.DataSource')
One of the pull requests on the project adds the ListView functionality I need.
How do I add this PR to my own project?
What I have tried:
created my own fork and manually added the files then tried to use npm to load it directly as per this SO question, it did not work, key core components were missing. The way one normally installs React-Native-Web is npm install --save react#0.14 react-dom#0.14 react-native-web and I tried npm install https:https://github.com/mcampsall/react-native-web
adding the files directly to my /dist folder. This did not work because I needed the babel translated versions of the files. I tried to use the babel REPL to translate them, but it is missing some plugins and gets hung up on certain parts of the code.
Thanks in advance.
EDIT: I just tried npm install --save react#0.14 react-dom#0.14 https://github.com/mcampsall/react-native-web as per Molda's suggestion and got:
├── babel#6.5.2 extraneous
├── babel-plugin-transform-decorators#6.8.0
├── babel-plugin-transform-decorators-legacy#1.3.4
├── babel-preset-react#6.5.0
├── UNMET PEER DEPENDENCY react#0.14.8
├── UNMET PEER DEPENDENCY react-dom#0.14.8
└─┬ react-native-web#0.0.25 (git+https://github.com/mcampsall/react-native-web.git#b448fb94cb29d08057eb72e4c13d09ad808f719a)
├─┬ fbjs#0.8.3
│ └── object-assign#4.1.0
└── react-textarea-autosize#4.0.3
npm WARN react-native-web#0.0.25 requires a peer of react#^15.1.0 but none was installed.
npm WARN react-native-web#0.0.25 requires a peer of react-dom#^15.1.0 but none was installed.
EDIT 2: tried npm install --save react#15.1.0 react-dom#15.1.0 https://github.com/mcampsall/react-native-web and when i do this i get an error npm WARN react-native#0.23.1 requires a peer of react#^0.14.5 but none was installed. which is a different version of react-native-web(0.23.1) than the original error (which was 0.25)...?
I then tried installing react#14.5 and it showed the original error again npm WARN react-native-web#0.0.25 requires a peer of react#^15.1.0 but none was installed.
I just tried this
npm install --save react#15.1.0 react-dom#15.1.0 git+https://git#github.com/mcampsall/react-native-web
and it installs without any error.
Make sure you delete all the packages before you install again or try to install into new empty folder

karma plugin dependencies not being found

When I run karma start I get the following issues
C:\devl\JS\myProject>karma start
06 09 2015 11:30:19.133:WARN [plugin]: Cannot find plugin "karma-chrome-launcher
".
Did you forget to install it ?
npm install karma-chrome-launcher --save-dev
06 09 2015 11:30:19.149:WARN [plugin]: Cannot find plugin "karma-firefox-launche
r".
Did you forget to install it ?
npm install karma-firefox-launcher --save-dev
06 09 2015 11:30:19.159:WARN [plugin]: Cannot find plugin "karma-ie-launcher".
Did you forget to install it ?
npm install karma-ie-launcher --save-dev
when I do npm list I can see the dependencies at the bottom of the tree
├─┬ karma-chrome-launcher#0.2.0
│ ├─┬ fs-access#1.0.0
│ │ └── null-check#1.0.0
│ └─┬ which#1.1.1
│ └─┬ is-absolute#0.1.7
│ └── is-relative#0.1.3
├── karma-firefox-launcher#0.1.6
├─┬ karma-ie-launcher#0.2.0
│ └── lodash#3.10.1
└── karma-jasmine#0.3.6
I have tried nuking my node_dependencies and running npm install again and i'm not sure what else to try
EDIT: I have verified in my node_dependencies directory and the plugin directories are in there.
There are a two seemingly-similar complaints when first getting started with Karma:
[preprocess]: Can not load "webpack", it is not registered!
Perhaps you are missing some plugin?
and
[plugin]: Cannot find plugin "karma-webpack".
Did you forget to install it ?
npm install karma-webpack --save-dev
The following is my best recommendation for fixing these two problems with your configuration…
"Can not load "XYZ", it is not registered!" (sic)
The typical solution to the 'Perhaps you are missing some plugin?' message is to make sure it's included within the plugins array in karma.conf.js.
plugins: [
'karma-chrome-launcher',
'karma-tap',
'karma-sourcemap-loader',
'karma-webpack' // *** This 'registers' the Karma webpack plugin.
],
"Cannot find plugin 'karma-xyz'."
If you've already installed it by running npm install karma-xyz --save-dev, but Karma still prompts (read: taunts) you with the "Did you forget to install it ?" warning, you may have a global installation of the Karma module.
Chances are that when you installed a global copy of the karma-cli using -g, you included karma (or were told to do so by a well-meaning tutorial), but that can cause problems resolving modules in certain versions (i.e., every version I've ever used). Karma's installation documentation recommends that the module should be a local installation using npm install karma --save-dev.
If you have a global Karma installation, try something like:
$ npm uninstall -g karma
$ npm install karma --save-dev
I think that you installed these plugins globally.
I had the same problem and I solved by installing the chrome-karma-launcher using the link flag:
npm install karma-chrome-launcher --save-dev --link
Do this with all browsers' plugins
npm install karma-firefox-launcher --save-dev --link
npm install karma-ie-launcher --save-dev --link
I don't know if this is the best approach, but this solved for me.
My answer might be a very rookie one, but did you add those plugins in the plugins array in the karma config file?
For example:
plugins: [
'karma-jasmine-html-reporter',
'karma-spec-reporter',
'karma-chrome-launcher',
'karma-jasmine',
'karma-coverage',
'karma-phantomjs-launcher'
],
Mine got resolved after I added the plugins to this array.
I had the same problem, but i fixed by this command :
npm install -g karma-cli
Just to add if someone come acrosss!!
I was getting an annoying issue, "Cannot load browser "Chrome": it is not registered! Perhaps you are missing some plugin?" when I run 'grunt test'
I had added the plugin in plugins[] in karma.conf.js, but still I was getting this error . The issue was I didn't add the plugin into karma:options:plugins array in GruntFile.js.After I added the plugin there, the issue vanished!!

Categories

Resources