jhipster-entity-audit threw exception when i try enable audit - jhipster

jhipster-entity-audit threw exception when i try enable audit, exception:
Reading the JHipster project configuration for your module
events.js:141
throw er; // Unhandled 'error' event
^
TypeError: jhipsterFunc.copyTemplate is not a function
at null.<anonymous>
at Array.forEach (native)
at copyFiles
at module.exports.yeoman.generators.Base.extend.writing.writeBaseFiles
at Object.<anonymous>
at npm\node_modules\generator-jhipster-entity-audit\node_modules\ye
nc\index.js:24:25
at processImmediate [as _immediateCallback] (timers.js:383:17)
I find issue about this problem generator-jhipster-entity-audit, but i begginer in npm.
Please tell me the best solution to this problem
UPD:
I trying download generator-jhipster from this repo and now i have problem when starting jhipster-entity-audit:
Error jhipster-entity-audit
You don't seem to have a generator with the name jhipster:modules installed.
You can see available generators with npm search yeoman-generator and then install them with npm install [name].
To see the 9 registered generators run yo with the `--help` option.

Don't use the deepu's repo, which is a fork
Use the official or install the latest version of generator-jhipster 2.27.0

Related

"Could not determine Node.js install directory" when running npm install

When attempting to run npm install, or when attempting to install anything through Node (like nvm) through any terminal (or in Visual Studio Code itself), I consistently get this error:
node:net:404
err = this._handle.open(fd);
^
Error: EISDIR: illegal operation on a directory, uv_pipe_open
at new Socket (node:net:404:24)
at createWritableStdioStream (node:internal/bootstrap/switches/is_main_thread:78:18)
at process.getStdout [as stdout] (node:internal/bootstrap/switches/is_main_thread:148:12)
at console.get (node:internal/console/constructor:210:42)
at console.value (node:internal/console/constructor:338:50)
at console.log (node:internal/console/constructor:377:61)
at evalScript (node:internal/process/execution:90:5)
at node:internal/main/eval_string:28:3 {
errno: -4068,
code: 'EISDIR',
syscall: 'uv_pipe_open'
}
Node.js v18.13.0
node:internal/modules/cjs/loader:1042
throw err;
^
Error: Cannot find module 'C:\node_modules\npm\bin\npm-cli.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:1039:15)
at Module._load (node:internal/modules/cjs/loader:885:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Node.js v18.13.0
Could not determine Node.js install directory
I have reinstalled node.js, npm, WSL, and Visual Studio Code multiple times attempting to fix the issue. I have also followed the suggested solutions here, here, and here to no avail. I have ensured that node and npm are added to my PATH as well in the environment variables. So far I've had no luck attempting to fix this solution. What else can I try? Are there any steps I could be missing?
I believe the issue was due to a corrupt installation of ubuntu itself, not node or WSL. Reinstalling ubuntu as a whole seemed to do the trick.

generating new nestjs module results in Error: Failed to execute command

I'm using MacOS monterey with M1 chip as my operating system. installed NestJS cli using this command: sudo npm install -g #nestjs/cli
when creating new nest project using nest new message everything works fine, but when I try to create new module using this command nest generate module messages I face error.
why does this happen? I tried installing schematics using npm i -g #nestjs/schematics, I don't know if I should've installed it but this didn't help anyway.
The error I face is:
/Users/homayoun/training/messages/node_modules/#angular-devkit/schematics-cli/bin/schematics.js:338
throw new Error(`Unknown argument ${key}. Did you mean ${(0, yargs_parser_1.decamelize)(key)}?`);
^
Error: Unknown argument skipImport. Did you mean skip-import?
at parseArgs (/Users/homayoun/training/messages/node_modules/#angular-devkit/schematics-cli/bin/schematics.js:338:19)
at main (/Users/homayoun/training/messages/node_modules/#angular-devkit/schematics-cli/bin/schematics.js:122:49)
at Object.<anonymous> (/Users/homayoun/training/messages/node_modules/#angular-devkit/schematics-cli/bin/schematics.js:367:5)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47
Failed to execute command: node #nestjs/schematics:module --name=messages --no-dry-run --no-skipImport --language="ts" --sourceRoot="src" --spec.
worth noting that I don't face any issues when I do the same thing on ubuntu 20 or 22
Quick solution:
add this to your nest-cli.json
"root": "src"
change into the src of your project folder
cd src
run
nest generate module messages
if the above does not work also try changing the version of packages in package.json to
"#nestjs/cli": "8.2.6",
"#nestjs/schematics": "8.0.11",
removing the node modules in the current project
reinstalling the nest cli with
npm uninstall -g #nestjs/cli
npm i -g #nestjs/cli#8.2.6
this is a bug on the latest version of #nestjs/cli (v8.2.7). Downgrade it to 8.2.6 and it will work (I tested it). It was reported here: https://github.com/nestjs/nest-cli/issues/1693
Also, I don't recommend using the global version of the CLI. Instead, use npx nest or yarn nest.

Building App with npm - Unhandled rejection Error: No element indexed by 9

I'm working on a vue app using tailwind, postcss and other packages.
When I do npm run serve the command vue-cli-service serve is called and it works without any problems.
When I do 'npm run build' the commadn vue-cli-service build is called and error "Building for production...Unhandled rejection Error: No element indexed by 9" occurs. After that the building process seems to run into a loop.
Building for production...tailwindcss: postcss.plugin was deprecated. Migration guide:
https://evilmartians.com/chronicles/postcss-8-plugin-migration
\ Building for production...Unhandled rejection Error: No element indexed by 9
at ArraySet_at [as at] (C:\Users\benny\Documents\Programmieren\Vue\cellCalculator\node_modules\source-map\lib\array-set.js:109:9)
at BasicSourceMapConsumer.<anonymous> (C:\Users\benny\Documents\Programmieren\Vue\cellCalculator\node_modules\source-map\lib\source-map-consumer.js:155:58)
at Array.map (<anonymous>)
at BasicSourceMapConsumer.SourceMapConsumer_eachMapping [as eachMapping] (C:\Users\benny\Documents\Programmieren\Vue\cellCalculator\node_modules\source-map\lib\source-map-consumer.js:146:14)
at Function.SourceNode_fromStringWithSourceMap [as fromStringWithSourceMap] (C:\Users\benny\Documents\Programmieren\Vue\cellCalculator\node_modules\source-map\lib\source-node.js:86:24)
at SourceMapSource.node (C:\Users\benny\Documents\Programmieren\Vue\cellCalculator\node_modules\webpack-sources\lib\SourceMapSource.js:32:25)
at ReplaceSource.node (C:\Users\benny\Documents\Programmieren\Vue\cellCalculator\node_modules\webpack-sources\lib\ReplaceSource.js:82:27)
at CachedSource.node (C:\Users\benny\Documents\Programmieren\Vue\cellCalculator\node_modules\webpack-sources\lib\CachedSource.js:18:24)
at ReplaceSource.node (C:\Users\benny\Documents\Programmieren\Vue\cellCalculator\node_modules\webpack-sources\lib\ReplaceSource.js:82:27)
at C:\Users\benny\Documents\Programmieren\Vue\cellCalculator\node_modules\webpack-sources\lib\ConcatSource.js:59:50
at Array.map (<anonymous>)
at ConcatSource.node (C:\Users\benny\Documents\Programmieren\Vue\cellCalculator\node_modules\webpack-sources\lib\ConcatSource.js:58:63)
at ConcatSource.proto.sourceAndMap (C:\Users\benny\Documents\Programmieren\Vue\cellCalculator\node_modules\webpack-sources\lib\SourceAndMapMixin.js:29:18)
at CachedSource.sourceAndMap (C:\Users\benny\Documents\Programmieren\Vue\cellCalculator\node_modules\webpack-sources\lib\CachedSource.js:58:31)
at getTaskForFile (C:\Users\benny\Documents\Programmieren\Vue\cellCalculator\node_modules\webpack\lib\SourceMapDevToolPlugin.js:65:30)
at C:\Users\benny\Documents\Programmieren\Vue\cellCalculator\node_modules\webpack\lib\SourceMapDevToolPlugin.js:215:20
\ Building for production...
I had to do compatibility build of postcss like here: https://v2.tailwindcss.com/docs/installation#post-css-7-compatibility-build
Could anybody provide some help or guidance how to resolve errors like this?
I already tried to delete node_modules and do npm install again.
Thanks!
I solved the issue by removing "#tailwindcss/forms": "^0.5.2"" from the dependencies.
After that I removed folder node_modules again. Then I did npm i an I recognized some warnings from npm. I fixed the waraings with npm audit fix. To fixe the issues which are not fixable with with this command I had to run npm audit fix --force.

truffle init node:internal/modules/cjs/loader:936

I wanted to create my own NFT collection so I bought a course called "The Complete NFT Web Development Course - Zero To Expert
". In that course you need to use truffle. I installed all what I sopposed to need but when I try to type truffle init it gives me an error. I used npm install also in this process and it gaves me an error related to react, but I don't think that it's the problem. I have a package.json downloaded from the github repositorie that the teacher have.
Versions:
npm: '8.3.1',
node: '16.14.0'
Windows 10
Error:
truffle init
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module 'C:\Users\Usuario\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js'
[90m at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)[39m
[90m at Function.Module._load (node:internal/modules/cjs/loader:778:27)[39m
[90m at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)[39m
[90m at node:internal/main/run_main_module:17:47[39m {
code: [32m'MODULE_NOT_FOUND'[39m,
requireStack: []
}
Try reinstalling truffle. If you reinstall truffle you will get upgraded version. And that might solve your problem.
Installing truffle version 5.4.29 install -g truffle#5.4.29 in the command prompt and got a message to run npm audit fix --force.
Then inside vscode inside terminal I ran truffle init and got the "sweet " message. I suppose the version matters.

Error running npm command TypeError: mkdirp is not a function

I already tried to uninstall the Nodejs and reinstall an other version but I keep on getting this error every time I run the command npm install or npm. when I try npm -v it returns the version.
My current installed nodejs versions is 10.16.0 and NPM is 6.12.0.
TypeError: mkdirp is not a function
at Conf.setUser (C:\Users\mrosus\AppData\Roaming\npm\node_modules\npm\lib\config\set-user.js:22:3)
at Conf.loadExtras (C:\Users\mrosus\AppData\Roaming\npm\node_modules\npm\lib\config\core.js:225:8)
at Conf. (C:\Users\mrosus\AppData\Roaming\npm\node_modules\npm\lib\config\core.js:166:12)
at Object.onceWrapper (events.js:286:20)
at Conf.emit (events.js:198:13)
at ConfigChain._resolve (C:\Users\mrosus\AppData\Roaming\npm\node_modules\npm\node_modules\config-chain\index.js:281:34)
at ConfigChain.add (C:\Users\mrosus\AppData\Roaming\npm\node_modules\npm\node_modules\config-chain\index.js:259:10)
at Conf.add (C:\Users\mrosus\AppData\Roaming\npm\node_modules\npm\lib\config\core.js:338:27)
at Conf. (C:\Users\mrosus\AppData\Roaming\npm\node_modules\npm\lib\config\core.js:314:25)
at ReadFileContext.callback (C:\Users\mrosus\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:90:16)
C:\Users\mrosus\AppData\Roaming\npm\node_modules\npm\lib\npm.js:59
throw new Error('npm.load() required')
^
Error: npm.load() required
at Object.get (C:\Users\mrosus\AppData\Roaming\npm\node_modules\npm\lib\npm.js:59:13)
at process.errorHandler (C:\Users\mrosus\AppData\Roaming\npm\node_modules\npm\lib\utils\error-handler.js:205:32)
at process.emit (events.js:198:13)
at process._fatalException (internal/bootstrap/node.js:496:27)
I had a similar problem, what happened to me was that I changed the version of my node, using a node version manager, I use the "n" https://github.com/tj/n . It turns out that when changing the version I did not see that I had given several error messages "Permission denied", that is, I thought I had changed the version but there was not, that somehow bugged my node and when I tried to use any command with npm it gave mistake.
To solve it, I simply changed the version using sudo, in my case, as I use the "n" node version manager, I ran the "sudo n" command and chose the node version.

Resources