Recently lodash package reported a security vulnerability issue on the github page. You can find details here. https://github.com/lodash/lodash/issues/5083.
This latest version of lodash has security vulnerability of Command Injection (CVE-2021-23337).
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-23337
https://snyk.io/vuln/SNYK-JS-LODASH-1040724
All versions of package lodash; all versions of package org.fujion.webjars:lodash are vulnerable to Command Injection via template.
They have resolved the issue and its fix is present in the lodash v4.17.21.
I am using the Angular 10 version. I am not using lodash directly but, One of the angular package that is #angular/localize#10.0.7 internally uses uses #babel/core#7.8.3 and this babel internally uses lodash#4.17.19.
Angular people will update the version number in their latest release and currently, I don't want to upgrade to the latest version of angular. Therefore, my question is how can I update only the lodash package, a child dependent(required dependency package for babel/core) from lodash#4.17.19 to v4.17.21 ?
npm update lodash did the trick for me.
$ npm -v
7.6.0
$ npm ls lodash
temp#1.0.0 /Users/trott/temp
└─┬ #angular/localize#10.2.4
└─┬ #babel/core#7.8.3
├─┬ #babel/traverse#7.13.0
│ └── lodash#4.17.19 deduped
├─┬ #babel/types#7.13.0
│ └── lodash#4.17.19 deduped
└── lodash#4.17.19
$ npm update lodash
changed 1 package, and audited 99 packages in 1s
6 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
$ npm ls lodash
temp#1.0.0 /Users/trott/temp
└─┬ #angular/localize#10.2.4
└─┬ #babel/core#7.8.3
├─┬ #babel/traverse#7.13.0
│ └── lodash#4.17.21 deduped
├─┬ #babel/types#7.13.0
│ └── lodash#4.17.21 deduped
└── lodash#4.17.21
$
This isn't exactly what you asked for because it updates to the latest lodash that satisfies the requirements of your dependencies, rather than the specific version 4.17.21. It just so happens that (at the time of this writing), that latest version for #angular/localize is 4.17.21. If you genuinely need a specific version that isn't the latest that satisfies your dependencies, read on.
Let's say, hypothetically, you wanted to update to 4.17.20. You might try npm update lodash#4.17.20. Alas, that doesn't work. The command runs fine, but doesn't update anything. In that case, you'd have to npm install lodash#4.17.20 first. That will update all your dependencies as well (assuming 4.17.20 satisfies their requirements). Then npm uninstall lodash#4.17.20 to remove it from your direct dependencies.
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)
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.
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
Error: Cannot find module 'underscore' thrown in console for all Meteor commands
After every meteor or meteorite command such as meteor or mrt create myapp the following error is thrown. This error seemed to appear suddenly, as meteor was functional the night before and no changes have been made since.
Austins-MacBook-Pro:Projects austinrivas$ mrt create test-app
/Users/austinrivas/.meteor/tools/3cba50c44a/tools/meteor.js:1480
}).run();
^
Error: Cannot find module 'underscore'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at /Users/austinrivas/.meteor/tools/3cba50c44a/tools/meteor.js:10:11
I have tried installing underscore manually with sudo npm install -g underscore which returns
Austins-MacBook-Pro:Projects austinrivas$ sudo npm install -g underscore
Password:
npm http GET https://registry.npmjs.org/underscore
npm http 200 https://registry.npmjs.org/underscore
npm http GET https://registry.npmjs.org/underscore/-/underscore-1.5.2.tgz
npm http 200 https://registry.npmjs.org/underscore/-/underscore-1.5.2.tgz
npm WARN unmet dependency /usr/local/share/npm/lib/node_modules/phonegap/node_modules/cordova requires colors#'>=0.6.0' but will load
npm WARN unmet dependency /usr/local/share/npm/lib/node_modules/phonegap/node_modules/colors,
npm WARN unmet dependency which is version 0.6.0-1
npm WARN unmet dependency /usr/local/share/npm/lib/node_modules/phonegap/node_modules/node-static requires colors#'>=0.6.0' but will load
npm WARN unmet dependency /usr/local/share/npm/lib/node_modules/phonegap/node_modules/colors,
npm WARN unmet dependency which is version 0.6.0-1
underscore#1.5.2 /usr/local/share/npm/lib/node_modules/underscore
My ~/.bash_profile has the following paths
export PATH=/usr/local/share/npm/bin:$PATH
export NODE_PATH="/usr/local/share/npm/lib/node_modules"
export NODE_OPTIONS="--debug"
I've even tried reinstalling node and doing an npm cache clean but I'm not sure what else to try.
Any further insight would be appreciated.
UPDATE
Running npm list -g underscore returns the following
Austins-MacBook-Pro:~ austinrivas$ npm list -g underscore
npm WARN unmet dependency /usr/local/share/npm/lib/node_modules/phonegap/node_modules/cordova requires colors#'>=0.6.0' but will load
npm WARN unmet dependency /usr/local/share/npm/lib/node_modules/phonegap/node_modules/colors,
npm WARN unmet dependency which is version 0.6.0-1
npm WARN unmet dependency /usr/local/share/npm/lib/node_modules/phonegap/node_modules/node-static requires colors#'>=0.6.0' but will load
npm WARN unmet dependency /usr/local/share/npm/lib/node_modules/phonegap/node_modules/colors,
npm WARN unmet dependency which is version 0.6.0-1
/usr/local/share/npm/lib
├─┬ meteorite#0.6.11
│ ├─┬ ddp#0.3.4
│ │ └─┬ meteor-ejson#0.6.3
│ │ └── underscore#1.4.4
│ └── underscore#1.5.1
├─┬ phonegap#3.0.0-0.14.0
│ └─┬ cordova#3.0.0
│ ├─┬ follow-redirects#0.0.3
│ │ └── underscore#1.5.1
│ └─┬ plugman#0.9.10
│ ├─┬ dep-graph#1.1.0
│ │ └── underscore#1.2.1
│ └── underscore#1.4.4
├── underscore#1.5.2
└─┬ ungit#0.1.8
└── underscore#1.4.4
I was able to resolve this error by completely uninstalling / reinstalling meteor and meteorite through the following steps.
sudo rm /usr/local/bin/meteor
rm -rf ~/.meteor
sudo mrt uninstall
sudo mrt uninstall --system
sudo chown -R `whoami` ~/.npm
curl https://install.meteor.com | /bin/sh
sudo -H npm install -g meteorite
I was able to verifying everything was working properly by running meteor --version and mrt create test-app
First off, your meteorite is out of date. To update meteorite run (sudo if applicable):
npm update -g meteorite
If you ran the 'mrt' or 'meteor' command as sudo in the past, it will cause issues. Clear meteorite by running:
sudo mrt uninstall
sudo mrt uninstall --system
sudo chown -R `whoami` ~/.npm
You also want to remove the 'build' folder inside existing projects, located in '/project/.meteor/local/build'