JHipster Version 7.9.3 Using Local Blueprint Gives npm ERR! 404 Not Found - jhipster

I use JFrog to manage my npm repository and have already created a virtual directory in which the blueprint exists (as part of the local directory). I have the following in my ~/.npmrc:
//jaiashirwaad.jfrog.io/artifactory/api/npm/default-npm-virtual/:_auth = asdfaasdfasdf23e234wadefasdfasdfasdfasd
email = info#mycompany.com
always-auth = true
I get the following when running the command: jhipster --blueprints saathratri-cassandra-blueprint jdl --skip-fake-data apps.jh:
INFO! Generator app child process exited with code 1idealTree:node_modules/string-width/node_modules/strip-ansi Completed in 1ms
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/generator-jhipster-saathratri-cassandra-blueprint - Not found
npm ERR! 404
npm ERR! 404 'generator-jhipster-saathratri-cassandra-blueprint#7.9.3' is not in this registry.
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/amar/.npm/_logs/2023-01-20T22_36_39_488Z-debug-0.log
ERROR! Command failed with exit code 1: npm install
Error: Command failed with exit code 1: npm install
at makeError (/usr/local/lib/node_modules/generator-jhipster/node_modules/yeoman-environment/node_modules/execa/lib/error.js:60:11)
at handlePromise (/usr/local/lib/node_modules/generator-jhipster/node_modules/yeoman-environment/node_modules/execa/index.js:118:26)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
shortMessage: 'Command failed with exit code 1: npm install',
command: 'npm install',
escapedCommand: 'npm install',
exitCode: 1,
signal: undefined,
signalDescription: undefined,
stdout: undefined,
stderr: undefined,
failed: true,
timedOut: false,
isCanceled: false,
killed: false
}
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/generator-jhipster-saathratri-cassandra-blueprint - Not found
npm ERR! 404
npm ERR! 404 'generator-jhipster-saathratri-cassandra-blueprint#7.9.3' is not in this registry.
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/amar/.npm/_logs/2023-01-20T22_36_55_013Z-debug-0.log
ERROR! Command failed with exit code 1: npm install
INFO! Generator app child process exited with code 1
Error: Command failed with exit code 1: npm install
at makeError (/usr/local/lib/node_modules/generator-jhipster/node_modules/yeoman-environment/node_modules/execa/lib/error.js:60:11)
at handlePromise (/usr/local/lib/node_modules/generator-jhipster/node_modules/yeoman-environment/node_modules/execa/index.js:118:26)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
shortMessage: 'Command failed with exit code 1: npm install',
command: 'npm install',
escapedCommand: 'npm install',
exitCode: 1,
signal: undefined,
signalDescription: undefined,
stdout: undefined,
stderr: undefined,
failed: true,
timedOut: false,
isCanceled: false,
killed: false
}
Please advise.

I solved this issue. I noticed the following in the package.json files of my services:
"devDependencies": {
"generator-jhipster": "7.6.0",
"generator-jhipster-saathratri-cassandra-blueprint": "7.6.0",
"prettier": "2.5.1",
"prettier-plugin-java": "1.6.1",
"prettier-plugin-packagejson": "2.2.15"
},
Perhaps I could have changed the line
"generator-jhipster-saathratri-cassandra-blueprint": "7.6.0",
to
"generator-jhipster-saathratri-cassandra-blueprint": "file:../relative/path/to/generator-jhipster-saathratri-cassandra-blueprint",
and the error would go away but I did not want to since it would involve me injecting my version of package.json.ejs myself in my blueprint.
I decided to search for the word "package.json" and "package.json.ejs" in the generator-jhipster directory and found:
In options.js:
'skip-jhipster-dependencies': {
desc: "Don't add generator-jhipster and blueprints to package.json.",
type: Boolean,
},
and then search for skipJhipsterDependencies and found:
<%_ if (!skipJhipsterDependencies) { _%>
"generator-jhipster": "<%= packagejs.version %>",
<%_ otherModules.forEach(module => { _%>
"<%= module.name %>": "<%= module.version %>",
<%_ }); _%>
<%_ } _%>
in package.json.ejs.
So I figured, from the above results, there was a way of not outputting my local blueprint in the services package.json's devDependencies section.
So I tried changing the command I run to: jhipster --blueprints saathratri-cassandra-blueprint jdl --skip-fake-data --skip-jhipster-dependencies apps.jh and that did the trick. No more 404 error.

Related

Next JS : Error: EPERM: operation not permitted, rmdir

I have a Next.js application that works and then when I leave it and come back to it I get
errno: -4048,
code: 'EPERM',
syscall: 'rmdir',
path: 'C:\\Users\\gmacr\\Google Drive\\Optical-Font-Website\\O\\.next\\server\\pages'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! opt#0.1.0 dev: `next dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the opt#0.1.0 dev 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! C:\Users\gmacr\AppData\Roaming\npm-cache\_logs\2021-10-16T21_14_26_886Z-debug.log
I tried using npm clean cache. using Windows 10. When I create a new Next app and copy my working files over the program runs without error until I leave it for a while and come back to it...
It happens to me when the project directory is inside "Google Drive"!!
All you have to do is delete the ".next" directory.
Or add a script to package.json to delete it (windows 10 tested):
"scripts": {
"dev": "(if exist .next rd /s /q .next 2>nul) && next dev",
},

next.js error: Error: > Build failed because of webpack errors

I'm trying to deploy a nextJs app but when I run npm run build I see some of the errors listed below:
Build error occurred
Error:
Build failed because of webpack errors
at /Users/hassan/Upwork/ROCProjectNext.js/ROCNext/node_modules/next/dist/build/index.js:15:918
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async /Users/hassan/Upwork/ROC Project Next.js/ROC- Next/node_modules/next/dist/build/tracer.js:1:525
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! admin-1.0#0.1.0 build: next build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the admin-1.0#0.1.0 build 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!
/Users/hassan/.npm/_logs/2021-04-07T06_52_28_325Z-debug.log
any suggestions?
Kindly check your nextjs version in package.json file it is upgraded to latest version. Downgrade the version of nextjs it will help you to avoid this error.

Trouble building react-webapp with ESLint; ESLint couldn't find the config "developit" to extend from

My react app works as normal using npm start, but when I try npm run build I got trouble.
Oops! Something went wrong! :(
ESLint: 6.8.0.
ESLint couldn't find the config "developit" to extend from. Please check that the name of the config is correct.
The config "developit" was referenced from the config file in "/home/user/beregning-innsikt/beregning-innsikt-webapp/src/main/webapp/node_modules/#babel/preset-modules/package.json".
If you still have problems, please stop by https://gitter.im/eslint/eslint to chat with the team.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! beregning-innsikt-webapp#2.0.0 lint: `eslint 'src/**/*{.ts,.tsx}'`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the beregning-innsikt-webapp#2.0.0 lint 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/user/.npm/_logs/2020-08-11T08_20_44_975Z-debug.log
ERROR: "lint" exited with 2.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! beregning-innsikt-webapp#2.0.0 prebuild: `npm-run-all clean lint && aurora-mi git`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the beregning-innsikt-webapp#2.0.0 prebuild 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/user/.npm/_logs/2020-08-11T08_20_45_002Z-debug.log
The Babel config file contains this:
"eslintConfig": {
"extends": "developit",
"rules": {
"no-console": 0,
"new-cap": 0
}
},
I have tried node v 13.7.0 and 14.1.0.
Does anybody know how to solve this problem?
Seems like it is linting node_modules too
To fix this you can create file .eslintignore in your root directory and add node_modules/ folder to your eslintignore file

Receiving TS2304: Cannot find name 'File' | TS2304: Cannot find name 'ReadableStream' when running "npm run tsc" command

I have a nodejs application using "watson-developer-cloud" module. Included this module using "npm install --save watson-developer-cloud".
I see the issue below when running "npm run tsc".
node_modules/ibm-cloud-sdk-core/lib/content-type.d.ts(4,35): error TS2304: Cannot find name 'File'.
node_modules/ibm-cloud-sdk-core/lib/content-type.d.ts(4,42): error TS2304: Cannot find name 'ReadableStream'.
I am running this on Mac.
node version 10.15.3.
I found few articles asking to set path to node bin directory and reload terminal.
I did that - although running into the same problem again.
node_modules/ibm-cloud-sdk-core/lib/content-type.d.ts(4,35): error TS2304: Cannot find name 'File'.
node_modules/ibm-cloud-sdk-core/lib/content-type.d.ts(4,42): error TS2304: Cannot find name 'ReadableStream'.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! my-program#1.0.0 tsc: `tsc`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the my-program#1.0.0 tsc 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/2019-03-25T14_29_06_333Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! my-program#1.0.0 build: `npm run tsc && npm run tslint`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the my-program#1.0.0 build 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/2019-03-25T14_29_06_351Z-debug.log
ERROR: Service 'my-program' failed to build: The command '/bin/sh -c npm run build' returned a non-zero code: 2```
The File and ReadableStream types are defined in the dom TypeScript library.
Try adding it to your tsconfig.json:
{
...
"compilerOptions": {
"lib": [
...
"dom"
]
}
}

package.json vs. "npm install %s -g"

A package.json example:
{
"devDependencies": {
"jasmine-node": ""
}
}
It just won't work. Some errors like the following will appear:
npm ERR! error rolling back Error: UNKNOWN, unlink '/vagrant/x/node_modules/jasmine-node/node_modules/jasmine-reporters/ext/env.rhino.1.2.js'
npm ERR! error rolling back jasmine-node#1.14.5 { [Error: UNKNOWN, unlink '/vagrant/x/node_modules/jasmine-node/node_modules/jasmine-reporters/ext/env.rhino.1.2.js']
npm ERR! error rolling back errno: -1,
npm ERR! error rolling back code: 'UNKNOWN',
npm ERR! error rolling back path: '/vagrant/x/node_modules/jasmine-node/node_modules/jasmine-reporters/ext/env.rhino.1.2.js' }
npm ERR! Error: UNKNOWN, symlink '../coffee-script/bin/coffee'
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:
npm ERR! http://github.com/npm/npm/issues
But if I do npm install jasmine-node -g, everything install and works seamlessly and I can't see why.
Can someone clarify this question for me?
You can try this:
sudo npm install jasmine-node#1.14.2 -g
Current version is 1.14.3, so it is one version behind.
In package.json try:
{
"devDependencies": {
"jasmine-node": ">=1.14.3"
"jasmine-reporters": "~1.0.0",
}
}
Remove that line from package.json and do npm install --save-dev jasmine-node that will install it and add the correct line in your devDependencies.

Resources