Yarn add babel/preset-react fails - babeljs

Using the command recommended by the docs:
> yarn add #babel/preset-react --dev
yarn add v1.17.3
[1/5] 🔍 Validating package.json...
[2/5] 🔍 Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/#babel%2freact: Not found".
According to the docs you can add git repo directly:
> yarn add https://github.com/babel/babel/tree/master/packages/babel-preset-react --dev
yarn add v1.17.3
[1/5] 🔍 Validating package.json...
[2/5] 🔍 Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/#babel%2freact: Not found".

Related

preventing yarn from running in wrong directory

Sometimes I run yarn (2) in the wrong directory, which can result in the download of thousands of files. Cleaning that up takes a lot of time.
Is there an easy way to prevent yarn from running in a certain directory?
I am using Windows, by the way. But an OS independent solution would be even nicer.
I found this solution:
In that directory create a subdirectory node_modules.
Remove the right to write in that subdirectory for the relevant user(s).
The result looks like this:
> yarn add cypress
yarn add v1.22.15
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
error An unexpected error occurred:
"EPERM: operation not permitted, mkdir 'C:\\...\\node_modules\\ansi-escapes'".
An nothing is downloaded into that node_modules.

Vercel 127 Error deploying vercel application

I'm trying to deploy on vercel, before it was working fine until I added a map library called leaflet and now it's giving an error in the deploy.. I tried to run npm run build in the terminal but still an error.
[10:00:20.566] Cloning github.com/daviroquedev/ride (Branch: master, Commit: 7e7d760)
[10:00:21.284] Cloning completed: 717.186ms
[10:00:21.853] Looking up build cache...
[10:00:22.163] Build Cache not found
[10:00:22.217] Running "vercel build"
[10:00:22.881] Vercel CLI 28.4.2
[10:00:23.187] Installing dependencies...
[10:00:23.831] npm ERR! must provide string spec
[10:00:23.834]
[10:00:23.835] npm ERR! A complete log of this run can be found in:
[10:00:23.835] npm ERR! /vercel/.npm/_logs/2022-09-27T13_00_23_618Z-debug-0.log
[10:00:23.850] Detected `package-lock.json` generated by npm 7+...
[10:00:23.850] Running "npm run build"
[10:00:24.243]
[10:00:24.243] > ride#0.0.0 build
[10:00:24.244] > vite build
[10:00:24.244]
[10:00:24.251] sh: vite: command not found
[10:00:24.259] Error: Command "npm run build" exited with 127
Build Failed
Command "npm run build" exited with 127
PACKAGE.JSON

yarn on wsl ubuntu 18.0 vscode not using lock file

Hi Trying to run a yarn install on project on WSL Ubuntu 18.04 using vscode. But yarn seems to not be using the yarn lockfile and I get errors about the wrong node engine when running yarn install....
cd-ing to the project directory and running sudo yarn install
yarn install v1.22.10
[1/4] Resolving packages...
[2/4] Fetching packages...
error juice#7.0.0: The engine "node" is incompatible with this module. Expected version ">=10.0.0". Got "8.10.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
it looks like its just using yarn from the usr install and not the local project directory what am I doing wrong?

Probleme to install Superdesk Newsroom

I'm trying to install newsromm from https://github.com/superdesk/newsroom
with installation with NPM I've these errors :
npm WARN deprecated babel-preset-es2015#6.24.1: Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
npm WARN deprecated nomnom#1.6.2: Package no longer supported. Contact support#npmjs.com for more info.
> node-sass#4.9.0 install /root/newsroom/node_modules/node-sass
> node scripts/install.js
internal/modules/cjs/loader.js:596
throw err;
^
Error: Cannot find module '/root/newsroom/node_modules/node-sass/scripts/install.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:594:15)
at Function.Module._load (internal/modules/cjs/loader.js:520:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:744:10)
at startup (internal/bootstrap/node.js:240:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:564:3)
npm WARN ajv-keywords#3.2.0 requires a peer of ajv#^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN newsroom No repository field.
npm WARN newsroom No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass#4.9.0 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#4.9.0 install 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! /root/.npm/_logs/2018-07-01T18_21_45_224Z-debug.log
and with installation with YARN everything looks good :
yarn install v1.7.0
(node:40422) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents#1.1.3: The platform "linux" is incompatible with this module.
info "fsevents#1.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > react-toggle#4.0.2" has unmet peer dependency "prop-types#^15.3.0".
[4/4] Building fresh packages...
Done in 236.13s.
but when I start the app , I'v this message:
honcho start -p 5050
18:17:07 system | web.1 started (pid=52710)
18:17:07 system | websocket.1 started (pid=52711)
18:17:08 websocket.1 | /usr/bin/python: No module named superdesk
18:17:08 system | websocket.1 stopped (rc=1)
18:17:08 system | sending SIGTERM to web.v
How can I resolve this ?
Blockquote
Newsroom is just a plugin for Superdesk. You need to install Superdesk as well from https://github.com/superdesk/superdesk.

JHipster Registry rejects gateways and microservices

I'm trying to use JHipster for a project using microservices, but the latest JHipster Registry won't let my gateway or microservices access the config server and rejects them.
I installed the JHipster Vagrant DevBox, then used docker run -p 8761:8761 jhipster/jhipster-registry to run the JHipster registry.
Then, I generated a gateway and 2 microservices following this, and it worked.
But then I wanted to use the JHipster Registry from GitHub, so I cloned it and runned it (apparently it had been updated to 2.0.0 in the meantime). Sadly, the gateway and the microservices weren't able to access this registry. They were still able to access the Docker image registry though (I suppose Docker didn't update it). But since it was fancier, and probably more up-to-date, I wanted to use the latest version of the registry, the same as the one from GitHub. So I tried to update the Docker image Jhipster Registry with docker pull. And now it won't work with either registry - Docker image or GitHub clone.
When a registry is running and I run a gateway or microservice, I get 6 times this:
2016-05-10 15:39:07.511 DEBUG 20706 --- [ main] s.n.www.protocol.http.HttpURLConnection : sun.net.www.MessageHeader#86ba8f5 pairs: {GET /config/gateway/dev/master HTTP/1.1: null}{Accept: application/json, application/*+json}{User-Agent: Java/1.8.0_91}{Host: localhost:8761}{Connection: keep-alive}
2016-05-10 15:39:07.522 DEBUG 20706 --- [ main] s.n.www.protocol.http.HttpURLConnection : sun.net.www.MessageHeader#43c7802510 pairs: {null: HTTP/1.1 401 Unauthorized}{Server: Apache-Coyote/1.1}{X-Content-Type-Options: nosniff}{X-XSS-Protection: 1; mode=block}{Cache-Control: no-cache, no-store, max-age=0, must-revalidate}{Pragma: no-cache}{Expires: 0}{Content-Type: application/json;charset=UTF-8}{Transfer-Encoding: chunked}{Date: Tue, 10 May 2016 15:39:07 GMT}
Then I get an error:
2016-05-10 15:39:13.781 ERROR 20706 --- [ main] o.s.boot.SpringApplication : Application startup failed
Then I get Java exceptions:
java.lang.IllegalStateException: Could not locate PropertySource and the fail fast property is set, failing
at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:110)
at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator$$FastClassBySpringCGLIB$$fa44b2a.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.retry.interceptor.RetryOperationsInterceptor$1.doWithRetry(RetryOperationsInterceptor.java:74)
at org.springframework.retry.support.RetryTemplate.doExecute(RetryTemplate.java:263)
at org.springframework.retry.support.RetryTemplate.execute(RetryTemplate.java:154)
at org.springframework.retry.interceptor.RetryOperationsInterceptor.invoke(RetryOperationsInterceptor.java:101)
at org.springframework.retry.annotation.AnnotationAwareRetryOperationsInterceptor.invoke(AnnotationAwareRetryOperationsInterceptor.java:118)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655)
at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator$$EnhancerBySpringCGLIB$$a0abff82.locate(<generated>)
at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:89)
at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:640)
at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:343)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at com.soprasteria.example.GatewayApp.main(GatewayApp.java:73)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:478)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.web.client.HttpClientErrorException: 401 Unauthorized
at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:91)
at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:641)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:597)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:557)
at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:475)
at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.getRemoteEnvironment(ConfigServicePropertySourceLocator.java:130)
at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:81)
... 23 common frames omitted
[WARNING]
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:478)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: Could not locate PropertySource and the fail fast property is set, failing
at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:110)
at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator$$FastClassBySpringCGLIB$$fa44b2a.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.retry.interceptor.RetryOperationsInterceptor$1.doWithRetry(RetryOperationsInterceptor.java:74)
at org.springframework.retry.support.RetryTemplate.doExecute(RetryTemplate.java:263)
at org.springframework.retry.support.RetryTemplate.execute(RetryTemplate.java:154)
at org.springframework.retry.interceptor.RetryOperationsInterceptor.invoke(RetryOperationsInterceptor.java:101)
at org.springframework.retry.annotation.AnnotationAwareRetryOperationsInterceptor.invoke(AnnotationAwareRetryOperationsInterceptor.java:118)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655)
at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator$$EnhancerBySpringCGLIB$$a0abff82.locate(<generated>)
at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:89)
at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:640)
at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:343)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at com.soprasteria.example.GatewayApp.main(GatewayApp.java:73)
... 6 more
Caused by: org.springframework.web.client.HttpClientErrorException: 401 Unauthorized
at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:91)
at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:641)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:597)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:557)
at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:475)
at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.getRemoteEnvironment(ConfigServicePropertySourceLocator.java:130)
at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:81)
... 23 more
And finally a BUILD FAILURE and a Maven error:
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.3.3.RELEASE:run (default-cli) on project gateway: An exception occurred while running. null: InvocationTargetException: Could not locate PropertySource and the fail fast property is set, failing: 401 Unauthorized -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
In the registry's shell I get this line 6 times too:
2016-05-10 15:39:07.519 DEBUG 17958 --- [io-8761-exec-10] i.g.j.r.s.Http401UnauthorizedEntryPoint : Pre-authenticated entry point called. Rejecting access
I tried updating everything, and I am currently trying to downgrade things (since the doc says "we recommend you use the same version tag as the one you use for your JHipster generator", but I don't think it'll work since JHipster Registry's latest version is 2.0.0 and the JHipster generator introduced microservices with the 3.0 version), and I also tried copying directly the secret from the central-server-config to the config of the applications, but apparently to no avail.
Could you help me with this ?
Thank you very much in advance.
EDIT:
I tried updating JHipster to 3.2.1 using npm install -g generator-jhipster, which apparently worked, but when I run yo jhipster, Yeoman still uses JHipster 3.1.0. Actually, even if I uninstall JHipster with npm uninstall -g generator-jhipster, Yeoman can still use JHipster 3.1.0...
EDIT:
It works fine if I reinstall everything locally (in the directory where I use yo jhipster).
However, I still can't update JHipster globally in Yeoman. When I try using npm install -g generator-jhipster, it updates JHipster globally to 3.2.1 but Yeoman still uses 3.1.0. If I try to update JHipster using yo/"Update your generators"/generator-jhipster, I get an error:
npm WARN deprecated npmconf#2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/generator-jhipster
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
/usr/local/lib
└── generator-jhipster#3.2.1
npm ERR! Linux 3.13.0-85-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "generator-jhipster"
npm ERR! node v4.4.4
npm ERR! npm v3.8.9
npm ERR! path /usr/local/lib/node_modules/generator-jhipster
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules/generator-jhipster'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, access '/usr/local/lib/node_modules/generator-jhipster']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules/generator-jhipster' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! /home/vagrant/npm-debug.log
I've just updated your generators. Remember, you can update
a specific generator with npm by running:
npm install -g generator-_______
Using sudo will do the same and sudo su give me this when I try to run yo:
/usr/local/lib/node_modules/yo/node_modules/configstore/index.js:53
throw err;
^
Error: EACCES: permission denied, open '/root/.config/configstore/insight-yo.json'
You don't have access to this file.
at Error (native)
at Object.fs.openSync (fs.js:549:18)
at Object.fs.readFileSync (fs.js:397:15)
at Object.create.all.get (/usr/local/lib/node_modules/yo/node_modules/configstore/index.js:34:26)
at Object.Configstore (/usr/local/lib/node_modules/yo/node_modules/configstore/index.js:27:44)
at new Insight (/usr/local/lib/node_modules/yo/node_modules/insight/lib/index.js:37:34)
at Object.<anonymous> (/usr/local/lib/node_modules/yo/lib/cli.js:163:11)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
EDIT:
Ok it does not work even with a local installation...
Well the gateway does access to the registry, but it displays a debug page when I try to access to localhost:8080.
Actually, during the generation, I get a permission denied again, and missing dependencies (gulp-rev).
I just saw this: "It is wise to use a tag to have a stable version: the JHipster DevBox tags are the same as the JHipster Generator tags, so using the DevBox v3.2.0 also means using the generator v3.2.0" on the DevBox GitHub page, so maybe I'll just delete and download the DevBox again...
This is because you upgraded the JHipster Registry to the 2.0.0 version. This new version is secured, and that's why you have 401 "unauthenticated" errors, as you didn't provide any login/password to connect.
3 solutions:
Stay with the older JHipster Registry version, that matches your JHipster version.
Add a login/password (by default it's admin/admin) to your Eureka and Spring Cloud Config URLs. The detailed documentation on securing the JHipster Registry is here - it is incomplete at the time of this writing, but I will update it shortly
Update to JHipster v3.2.1, that is meant to be used with JHipster Registry v2.0.0, and where everything will be automatically configured.
I found the same behavior when using the latest JHipster Registry pulled from github running locally with IntelliJ IDEA -- the server would start but the frontend would not serve up.
It turned out to be an issue with a blank working directory in the Run/Debug Configuration. Once that is populated, things work find from the IDE.