Why is covering all paths to a dependency in package.json's "resolutions" not enough to pass "yarn audit"? - yarnpkg

In the project I work on, I see this warning from yarn audit (version 1.22.19):
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ moderate │ Got allows a redirect to a UNIX socket │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ got │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=11.8.5 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ #storybook/cli │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ #storybook/cli > update-notifier > latest-version > │
│ │ package-json > got │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://www.npmjs.com/advisories/1080920 │
└───────────────┴──────────────────────────────────────────────────────────────┘
Adding "#storybook/cli/**/got": "^11.8.5", to resolutions fixes it. So far so good. But I also have
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high │ glob-parent before 5.1.2 vulnerable to Regular Expression │
│ │ Denial of Service in enclosure regex │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ glob-parent │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=5.1.2 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ #storybook/cli │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ #storybook/cli > #storybook/core-common > webpack > │
│ │ watchpack > watchpack-chokidar2 > chokidar > glob-parent │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://www.npmjs.com/advisories/1081884 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high │ glob-parent before 5.1.2 vulnerable to Regular Expression │
│ │ Denial of Service in enclosure regex │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ glob-parent │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=5.1.2 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ #storybook/cli │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ #storybook/cli > #storybook/telemetry > │
│ │ #storybook/core-common > webpack > watchpack > │
│ │ watchpack-chokidar2 > chokidar > glob-parent │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://www.npmjs.com/advisories/1081884 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high │ glob-parent before 5.1.2 vulnerable to Regular Expression │
│ │ Denial of Service in enclosure regex │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ glob-parent │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=5.1.2 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ #storybook/react │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ #storybook/react > #storybook/core > #storybook/core-server │
│ │ > #storybook/core-common > webpack > watchpack > │
│ │ watchpack-chokidar2 > chokidar > glob-parent │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://www.npmjs.com/advisories/1081884 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high │ glob-parent before 5.1.2 vulnerable to Regular Expression │
│ │ Denial of Service in enclosure regex │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ glob-parent │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=5.1.2 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ #storybook/react │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ #storybook/react > #storybook/core > #storybook/core-server │
│ │ > #storybook/telemetry > #storybook/core-common > webpack > │
│ │ watchpack > watchpack-chokidar2 > chokidar > glob-parent │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://www.npmjs.com/advisories/1081884 │
└───────────────┴──────────────────────────────────────────────────────────────┘
and neither
"#storybook/cli/**/glob-parent": "^5.1.2",
"#storybook/react/**/glob-parent": "^5.1.2",
nor
"**/chokidar/glob-parent": "^5.1.2",
let me fix it. Actually, while writing the question, I found that adding all 3 does work. Is there a simple explanation why?

Related

Is there a way to have test folders near to main_test.go?

I want to create subfolders with tests and work with same main_test.go
Is it possible?
project
...
│
└───tests
│ │ main_test,go
│ │ some_test.go
│ │
│ └───subfolder1
│ │ another_test.go
│ │ again_test.go
...
I didn't find a way to solve this problem

How do I serve a React application from an Spring Boot application?

I would like to serve the results of the Webpack build of a ReactJS UI application from a Spring Boot server application.
As the Webpack build generates all the assets in a "dist" folder i.e. index.html, bundle.js, etc... Accessed as i.e. http://localhost/index.html
And the Spring Boot application serves the API URLs from i.e. http://localhost/api/xxx
create .env file in the root of react project (next to package.json)
put PUBLIC_URL=/nameContextRoot in .env file (name of context root typically is name of war file)
build react project npm run build
For me it generates its contents in build directory of react project
copy the contents of the build directory to the spring-boot apps static directory
static directory should be a normal folder in src/main/resources
clean and rebuild spring boot project and run it
Contents are now properly served
UPDATE
Spring Boot structure
D:.
├───.mvn
│ └───wrapper
├───.settings
├───src
│ ├───main
│ │ ├───java
│ │ │ └───my.java.stuff
│ │ ├───resources
│ │ │ └───static
│ │ │ └───static
│ │ │ ├───css
│ │ │ └───js
│ │ └───webapp
│ └───test
│ └───java
│ └───my.java.tests
├───target
│ ├───classes
│ │ ├───java.classes
│ │ └───static
│ │ ├───css
│ │ ├───js
│ │ └───static
│ │ ├───css
│ │ └───js
│ ├───generated-sources
│ │ └───annotations
│ ├───m2e-wtp
│ │ └───web-resources
│ │ └───META-INF
│ │ └───maven
│ │ └───java.stuff
│ ├───maven-archiver
│ ├───maven-status
│ │ └───maven-compiler-plugin
│ │ └───compile
│ │ └───default-compile
│ ├───rclient-0.0.1-SNAPSHOT
│ │ ├───META-INF
│ │ └───WEB-INF
│ │ ├───classes
│ │ │ ├───java stuff
│ │ │ └───static
│ │ └───lib
│ └───test-classes
└───WebContent
└───META-INF
ReactJS project structure
D:.
├───build
│ └───static
│ ├───css
│ └───js
├───node_modules
├───public
└───src
├───components
├───domain
└───util
Your api endpoints will be also served below the context root. They have nothing to do with React.
The hint of #Codo to use a reverse proxy to access the static content is still valid. But here you asked specifically for how to host the react app in a spring boot application.

nativescript application runs slow and freezes when navigating on android devices but runs excellent on ios

I have exhausted any suggestions available online.
I have tried setting markingMode in the package.json
"android": {
"markingMode": "none"
}
I have tried several methods of loading the viewModels.
I have tried saving to physical files and reading from them.
I have tried loading the json data fore each view into the appSettings.
I have tried uninstalling sass plugin sidedrawer plugin.
I have updated all the plugins including the core components.
Here are the plugins/versions
nativescript-appversion │ ^1.4.1 │ │
nativescript-iqkeyboardmanager │ ^1.4.0 │ │
nativescript-keyboard-toolbar │ ^1.0.4 │ │
nativescript-local-notifications │ ^3.1.0 │ │
nativescript-orientation │ ^2.2.1 │ │
nativescript-pager │ ^9.3.14 │ │
nativescript-plugin-firebase │ ^8.0.0 │ │
nativescript-pulltorefresh │ ^2.2.0 │ │
nativescript-social-share │ ^1.5.1 │ │
nativescript-sound │ ^1.0.4 │ │
nativescript-ui-sidedrawer │ ^6.0.0 │ │
nativescript-windowed-modal │ ^5.0.6 │ │
rxjs │ ^6.3.3 │ │
tns-core-modules │ ^5.2.2
The application should be able to navigate different views without freezing or slowing down.
I was facing exact the same issue. Use the configuration below on /src/package.json, not in the main package.json.
{
"main": "main.js",
"android": {
"v8Flags": "--expose_gc",
"markingMode": "none"
}
}
More info here: https://www.nativescript.org/blog/markingmode-none-is-official-boost-android-performance-while-avoiding-memory-issues

Eclipse vs. Spring Boot gives JSP error: Fragment "/js/home.js" was not found at expected path /src/main/webapp/js/home.js

I have the line
<script type="text/javascript">
<%#include file="/js/home.js" %>
Which gives the error in title. The JS files are in /src/main/resources/static/js. The error goes away if I create /src/main/webapp/js/home.js. This answer says webapp/ is not recommended. https://stackoverflow.com/a/28727189/148844. We are using JARs and we are uploading a WAR to AWS via the web console. Eclipse expects webapp/js/ and Spring Boot expects resources/static/js, so which should I use? How do I tell Eclipse how to find the JS file?
$ tree
├───src
│ ├───main
│ │ ├───java
│ │ ├───resources
│ │ │ └───static
│ │ │ ├───css
│ │ │ ├───fonts
│ │ │ ├───img
│ │ │ └───js
│ │ └───webapp
│ │ └───WEB-INF
│ │ └───jsp
We also have
spring.mvc.view.prefix: /WEB-INF/jsp/
spring.mvc.view.suffix: .jsp
Eclipse Version: Photon Release (4.8.0)

Ionic Setup Sass is giving me errors

I have researched all over the place trying to find a solution. I am on Windows 10. I am unable to run "ionic setup sass". Here are the errors I receive when I run it as administrator.
Ionic project ready to use Sass!
* Customize the app using scss/ionic.app.scss
* Run ionic serve to start a local dev server and watch/compile Sass to CSS
C:\Users\Chase\Desktop\ionFullApp_1.3.0\node_modules\gulp-sass\node_modules\node-sass\lib\index.js:22
throw new Error('`libsass` bindings not found. Try reinstalling `node-sass`?');
^
Error: `libsass` bindings not found. Try reinstalling `node-sass`?
at getBinding (C:\Users\Chase\Desktop\ionFullApp_1.3.0\node_modules\gulp-sass\node_modules\node-sass\lib\index.js:22:11)
at Object.<anonymous> (C:\Users\Chase\Desktop\ionFullApp_1.3.0\node_modules\gulp-sass\node_modules\node-sass\lib\index.js:188:23)
at Module._compile (module.js:425:26)
at Object.Module._extensions..js (module.js:432:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.<anonymous> (C:\Users\Chase\Desktop\ionFullApp_1.3.0\node_modules\gulp-sass\index.js:3:17)
at Module._compile (module.js:425:26)
Error running gulp sass
Exception with (CLI v1.7.12)
Your system information:
Cordova CLI: 5.4.1
Gulp version: CLI version 3.9.0
Gulp local: Local version 3.9.0
Ionic Version: 1.0.1
Ionic CLI Version: 1.7.12
Ionic App Lib Version: 0.6.5
OS:
Node Version: v5.1.0
I have tried uninstalling node-sass and installing it again using "npm uninstall node-sass" and "npm install node-sass". I have tried deleting the node_modules folder and doing "npm install" again.
When I use "ionic serve" to look at the app I have, these are the errors I get:
ionic $ C:\Users\Chase\Desktop\ionFullApp_1.3.0\node_modules\gulp-sass\node_modules\node-sass\lib\index.js:22
throw new Error('`libsass` bindings not found. Try reinstalling `node-sass`?');
^
Error: `libsass` bindings not found. Try reinstalling `node-sass`?
at getBinding (C:\Users\Chase\Desktop\ionFullApp_1.3.0\node_modules\gulp-sass\node_modules\node-sass\lib\index.js:22:11)
at Object.<anonymous> (C:\Users\Chase\Desktop\ionFullApp_1.3.0\node_modules\gulp-sass\node_modules\node-sass\lib\index.js:188:23)
at Module._compile (module.js:425:26)
at Object.Module._extensions..js (module.js:432:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.<anonymous> (C:\Users\Chase\Desktop\ionFullApp_1.3.0\node_modules\gulp-sass\index.js:3:17)
at Module._compile (module.js:425:26)
I have also tried uninstalling and reinstalling gulp-sass. When I run npm install gulp-sass, this is what I get:
$ npm install gulp-sass
npm WARN deprecated pangyp#2.3.3: use node-gyp#3+ instead
npm WARN prefer global pangyp#2.3.3 should be installed with -g
> node-sass#2.1.1 install C:\Users\Chase\Desktop\ionFullApp_1.3.0\node_modules\gulp-sass\node_modules\node-sass
> node scripts/install.js
Can not download file from https://raw.githubusercontent.com/sass/node-sass-binaries/v2.1.1/win32-x64-node-5.1/binding.node
> node-sass#2.1.1 postinstall C:\Users\Chase\Desktop\ionFullApp_1.3.0\node_modules\gulp-sass\node_modules\node-sass
> node scripts/build.js
module.js:340
throw err;
^
Error: Cannot find module 'C:\Users\Chase\Desktop\ionFullApp_1.3.0\node_modules\gulp-sass\node_modules\node-sass\node_modules\pangyp\bin\node-gyp'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:289:25)
at Function.Module.runMain (module.js:457:10)
at startup (node.js:138:18)
at node.js:974:3
Build failed
ionfullapp#1.2.0 C:\Users\Chase\Desktop\ionFullApp_1.3.0
├─┬ bower#1.7.1
│ ├─┬ bower-json#0.4.0
│ │ └── graceful-fs#2.0.3
│ ├─┬ configstore#0.3.2
│ │ └── object-assign#2.1.1
│ ├─┬ glob#4.5.3
│ │ └── minimatch#2.0.10
│ ├── graceful-fs#3.0.8
│ ├─┬ mkdirp#0.5.0
│ │ └── minimist#0.0.8
│ └─┬ request#2.53.0
│ ├── aws-sign2#0.5.0
│ ├─┬ bl#0.9.4
│ │ └── readable-stream#1.0.33
│ ├─┬ combined-stream#0.0.7
│ │ └── delayed-stream#0.0.5
│ ├── forever-agent#0.5.2
│ ├─┬ form-data#0.2.0
│ │ └── async#0.9.2
│ ├─┬ http-signature#0.10.1
│ │ ├── asn1#0.1.11
│ │ └── ctype#0.5.3
│ ├─┬ mime-types#2.0.14
│ │ └── mime-db#1.12.0
│ └── qs#2.3.3
├─┬ gulp#3.9.0
│ ├── gulp-util#3.0.7
│ └─┬ vinyl-fs#0.3.14
│ ├─┬ glob-stream#3.1.18
│ │ ├── glob#4.5.3
│ │ ├── minimatch#2.0.10
│ │ └─┬ through2#0.6.5
│ │ └── readable-stream#1.0.33
│ ├── graceful-fs#3.0.8
│ └─┬ through2#0.6.5
│ └── readable-stream#1.0.33
├─┬ gulp-angular-templatecache#1.8.0
│ ├─┬ gulp-concat#2.6.0
│ │ ├── gulp-util#3.0.7
│ │ └─┬ through2#0.6.5
│ │ └── readable-stream#1.0.33
│ └── gulp-util#3.0.7
├─┬ gulp-flatten#0.1.1
│ └── gulp-util#3.0.7
├─┬ gulp-if#1.2.5
│ ├─┬ ternary-stream#1.2.3
│ │ ├─┬ merge-stream#0.1.8
│ │ │ └─┬ through2#0.6.5
│ │ │ └── readable-stream#1.0.33
│ │ └─┬ through2#0.6.5
│ │ └── readable-stream#1.0.33
│ └─┬ through2#0.6.5
│ └── readable-stream#1.0.33
├─┬ gulp-json-editor#2.2.1
│ ├── gulp-util#3.0.7
│ └─┬ through2#0.5.1
│ └── readable-stream#1.0.33
├─┬ gulp-minify-css#1.2.2
│ └── gulp-util#3.0.7
├─┬ gulp-ng-annotate#1.1.0
│ ├── gulp-util#3.0.7
│ └─┬ through2#0.4.2
│ └── readable-stream#1.0.33
├─┬ gulp-ng-constant#0.3.0
│ ├── lodash#2.4.2
│ └─┬ through2#0.4.2
│ └── readable-stream#1.0.33
├─┬ gulp-preprocess#1.2.0
│ └── lodash#2.4.2
├─┬ gulp-sass#1.3.3
│ ├── clone#0.1.19
│ ├── gulp-util#3.0.7
│ └─┬ node-sass#2.1.1
│ ├─┬ chalk#0.5.1
│ │ ├── ansi-styles#1.1.0
│ │ ├─┬ has-ansi#0.1.0
│ │ │ └── ansi-regex#0.2.1
│ │ ├── strip-ansi#0.3.0
│ │ └── supports-color#0.2.0
│ ├── cross-spawn#0.2.9
│ ├─┬ gaze#0.5.2
│ │ └─┬ globule#0.1.0
│ │ └── minimatch#0.2.14
│ ├─┬ mocha#2.3.4
│ │ ├── commander#2.3.0
│ │ ├── diff#1.4.0
│ │ ├── escape-string-regexp#1.0.2
│ │ ├─┬ glob#3.2.3
│ │ │ ├── graceful-fs#2.0.3
│ │ │ └── minimatch#0.2.14
│ │ ├── growl#1.8.1
│ │ ├─┬ jade#0.26.3
│ │ │ ├── commander#0.6.1
│ │ │ └── mkdirp#0.3.0
│ │ ├─┬ mkdirp#0.5.0
│ │ │ └── minimist#0.0.8
│ │ └── supports-color#1.2.0
│ ├── nan#1.9.0
│ ├─┬ npmconf#2.1.2
│ │ └── uid-number#0.0.5
│ ├── object-assign#2.1.1
│ ├─┬ pangyp#2.3.3
│ │ ├── glob#4.3.5
│ │ ├── graceful-fs#3.0.8
│ │ ├── minimatch#2.0.10
│ │ ├─┬ request#2.51.0
│ │ │ ├── aws-sign2#0.5.0
│ │ │ ├─┬ bl#0.9.4
│ │ │ │ └── readable-stream#1.0.33
│ │ │ ├── caseless#0.8.0
│ │ │ ├─┬ combined-stream#0.0.7
│ │ │ │ └── delayed-stream#0.0.5
│ │ │ ├── forever-agent#0.5.2
│ │ │ ├─┬ form-data#0.2.0
│ │ │ │ ├── async#0.9.2
│ │ │ │ └─┬ mime-types#2.0.14
│ │ │ │ └── mime-db#1.12.0
│ │ │ ├─┬ hawk#1.1.1
│ │ │ │ ├── boom#0.4.2
│ │ │ │ ├── cryptiles#0.2.2
│ │ │ │ ├── hoek#0.9.1
│ │ │ │ └── sntp#0.2.4
│ │ │ ├─┬ http-signature#0.10.1
│ │ │ │ ├── asn1#0.1.11
│ │ │ │ └── ctype#0.5.3
│ │ │ ├── mime-types#1.0.2
│ │ │ ├── oauth-sign#0.5.0
│ │ │ └── qs#2.3.3
│ │ └── tar#1.0.3
│ ├─┬ request#2.67.0
│ │ └─┬ har-validator#2.0.3
│ │ └── commander#2.9.0
│ └─┬ sass-graph#1.3.0
│ ├── commander#2.9.0
│ ├─┬ glob#4.5.3
│ │ └── minimatch#2.0.10
│ └── lodash#2.4.2
├─┬ gulp-shell#0.4.3
│ └── gulp-util#3.0.7
├─┬ gulp-uglify#1.5.1
│ └── gulp-util#3.0.7
├─┬ gulp-useref#1.3.0
│ ├── gulp-util#3.0.7
│ ├─┬ through2#0.6.5
│ │ └── readable-stream#1.0.33
│ └─┬ vinyl-fs#1.0.0
│ ├─┬ glob-stream#4.1.1
│ │ ├── glob#4.5.3
│ │ └── minimatch#2.0.10
│ ├── graceful-fs#3.0.8
│ └── object-assign#2.1.1
├─┬ gulp-util#2.2.20
│ ├─┬ chalk#0.5.1
│ │ ├── ansi-styles#1.1.0
│ │ ├─┬ has-ansi#0.1.0
│ │ │ └── ansi-regex#0.2.1
│ │ ├── strip-ansi#0.3.0
│ │ └── supports-color#0.2.0
│ └─┬ through2#0.5.1
│ └── readable-stream#1.0.33
├─┬ jshint#2.8.0
│ └── minimatch#2.0.10
└─┬ mv#2.1.1
└─┬ mkdirp#0.5.1
└── minimist#0.0.8
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Chase\Desktop\ionFullApp_1.3.0\node_modules\mocha\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Chase\Desktop\ionFullApp_1.3.0\node_modules\node-sass\package.json'
npm WARN ionfullapp#1.2.0 No repository field.
npm WARN ionfullapp#1.2.0 No license field.
Any help would be greatly appreciated. I am completely stuck at this point.
I solved this problem by deleting the node_modules folder entirely and reinstalling everything with npm install
did you tried: npm install node-gyp?
for Mac-Users with sudo
sorry i cant comment
Greetz
It's very late answer. But I tried the following and it works for me.
sudo ionic setup sass

Resources