nrwl NX init fails in make-angular-cli-faster init - migration

I have an existing angular cli project (V12.2.16).
Im trying to migrate it to an NX standalone Application with the command :
npx nx init
Im getting an error:
Error: Command failed: npx --yes make-angular-cli-faster#latest init
at checkExecSyncError (child_process.js:790:11)
at execSync (child_process.js:863:15)
at Object.<anonymous> (C:\Code\harmony-encore-fe\node_modules\#nrwl\cli\node_modules\nx\src\command-line\init.js:22:46)
at Generator.next (<anonymous>)
at C:\Code\harmony-encore-fe\node_modules\tslib\tslib.js:167:75
at new Promise (<anonymous>)
at Object.__awaiter (C:\Code\harmony-encore-fe\node_modules\tslib\tslib.js:163:16)
at Object.initHandler (C:\Code\harmony-encore-fe\node_modules\#nrwl\cli\node_modules\nx\src\command-line\init.js:12:20)
at C:\Code\harmony-encore-fe\node_modules\#nrwl\cli\node_modules\nx\src\command-line\nx-commands.js:207:71
at Generator.next (<anonymous>) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 10148,
stdout: null,
stderr: null
}
I tried running the command npx --yes make-angular-cli-faster#latest init
Standalone but it gives me the following error:
The system cannot find the path specified.
Any suggestions on how to solve such an issue ?
Thanks.
Tried to migrate to an NX standalone application and was expecting to migrate succcesfyly but the result was an error thrown from NX.

Which NodeJs version are you using?
I had the same error while I was running npx nx init on NodeJs 14.19.3 and it works fine running it on NodeJs 16.16.0.
I hope it helps.

Related

VUe.js run serve failing after installation

I have installed Vue on my terminal with :
sudo npm install -g #vue/cli
After that , I created a project, moved into the folder and tried to run the server :
vue create frontend
cd frontend
npm run serve
So , I didn't change anything from the presets but I can't launch my server and I get the following error :
ERROR Failed to compile with 1 error 21:56:21
error in ./src/App.vue?vue&type=script&lang=js
Syntax Error: RangeError: /home/simao/Desktop/chess_DB/frontend/src/App.vue: Maximum call stack size exceeded
at Array.map (<anonymous>)
at Array.map (<anonymous>)
at Array.map (<anonymous>)
at Array.map (<anonymous>)
at Array.map (<anonymous>)
# ./src/App.vue?vue&type=script&lang=js 1:0-262 1:0-262 1:263-514 1:263-514
# ./src/App.vue
# ./src/main.js
# multi (webpack)-dev-server/client?http://192.168.1.19:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js
I looked into App.vue and main.js but this feels strange since I haven't touched the files after installing vue. Any idea what it might be ?
Vue version : #vue/cli 4.5.15
node : v16.14.0
OS : Ubuntu 20.04
Thats cannot be a problem but maybe is difference between 'npm runserve' and 'npm run serve' command?

React-native: error #jest/create-cache-key-function#27.4.2: The engine "node" is incompatible with this module. Expected version

I am almost starter on react-native. Trying to create a new project but I get the below error. I am using Windows 7, latest applicable node version for my operating system is 13.14.0. Is it about this? Any help is appreciated.
[2/4] Fetching packages...
error #jest/create-cache-key-function#27.4.2: The engine "node" is incompatible with this module. Expected
version "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0". Got "13.14.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Error: Command failed: yarn add react-native --exact
at checkExecSyncError (child_process.js:611:11)
at execSync (child_process.js:647:15)
at run (C:\Users\SAMSUNG\AppData\Roaming\npm\node_modules\react-native-cli\index.js:294:5)
at createProject (C:\Users\SAMSUNG\AppData\Roaming\npm\node_modules\react-native-cli\index.js:249:3)
at init (C:\Users\SAMSUNG\AppData\Roaming\npm\node_modules\react-native-cli\index.js:200:5)
at Object.<anonymous> (C:\Users\SAMSUNG\AppData\Roaming\npm\node_modules\react-native-cli\index.js:153:7)
at Module._compile (internal/modules/cjs/loader.js:1118:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1138:10)
at Module.load (internal/modules/cjs/loader.js:982:32)
at Function.Module._load (internal/modules/cjs/loader.js:875:14) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 9344,
stdout: null,
stderr: null
}
Command `yarn add react-native --exact` failed.
At first line of the error, it is written that,
"Expected version "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0"
so you Need to update Node version.

react native init failed

whenever I create a new project then it throws the following Error. I did update any settings. everything was working fine before yesterday. Here is my issue.
[1/4] Resolving packages...
error Couldn't find package **"#typescript-eslint/parser#^4.22.1"** required by **"#react-native-community/eslint-config"** on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
E:\example\project\node_modules\execa\index.js:174
err = new Error(`Command failed: ${joinedCmd}${output}`);
^
Error: Command failed: yarn add -D #babel/core #babel/runtime #react-native-community/eslint-config eslint jest babel-jest metro-react-native-babel-preset react-test-renderer#17.0.1
at makeError (E:\example\project\node_modules\execa\index.js:174:9)
at E:\example\project\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async generateProject (E:\example\project\node_modules\#react-native-community\cli\build\commands\init\initCompat.js:128:3)
at async Object.initCompat (E:\example\project\node_modules\#react-native-community\cli\build\commands\init\initCompat.js:105:3) {
code: 1,
stdout: null,
stderr: null,
failed: true,
signal: null,
cmd: 'yarn add -D #babel/core #babel/runtime #react-native-community/eslint-config eslint jest babel-jest metro-react-native-babel-preset react-test-renderer#17.0.1',
timedOut: false,
killed: false
}
I did all remove a node, update node, removed react-native-CLI, and update it and it was fixed for some time. but I was unable to install any package.
it's now day 2 and I am stuck here.
before running react-native init try running npm install #typescript-eslint/parser#^4.22.1 I hope it resolves the issue.
if the issue persists try clearing cache with:
npm cache clean --force
Finally after search for a long time. I found a solution. just go to the network setting and turn off automatic proxy setting detection.

Appium - Android - Error: spawn appium ENOENT

I am trying to run android tests with the command node ./node_modules/.bin/wdio config/wdio.android.browser.conf.js and getting the following error:
me$ node ./node_modules/.bin/wdio config/wdio.android.browser.conf.js
events.js:183
throw er; // Unhandled 'error' event
^
Error: spawn appium ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
at onErrorNT (internal/child_process.js:362:16)
at _combinedTickCallback (internal/process/next_tick.js:139:11)
at process._tickDomainCallback (internal/process/next_tick.js:219:9)
at Function.Module.runMain (module.js:696:11)
at startup (bootstrap_node.js:204:16)
at bootstrap_node.js:625:3
I have the following versions in my package.json:
"wdio-appium-service": "^0.2.3",
"appium": "^1.12.1",
Please let me know what other info I can provide. Thank you.
I think I figured it out... in config/wdio.android.browser.conf.js I had services: [ 'appium' ], and trying to run just appium on my machine wasn't working. I installed appium globally with npm install -g appium and that made it work. I think I can point services to the appium in the local node_modules directory and maybe it would run it from there.
If you are using windows OS, appium section in your config file shall include command: 'appium.cmd' like this :
{
services: ['appium'],
appium: {
command: 'appium.cmd',
...
}
}
This error occurs due to 2 possible issues:
1) JAVAHOME variable is not correctly set for appium to start & run tests.
-> Check that JAVAHOME is correctly set and path points to the correct file.
2) There could have been some errors during Appium installation.
-> Try reinstalling appium using npm install -g appium command and ensure that appium is installed without any errors.
Obviously, run npm install to check and install any missing dependencies too.

Error about vue.js appears when try to make a gulp production

When I'm trying to make gulp --production I get this error:
[14:27:45] Using gulpfile ~/www/webpage/gulpfile.js
[14:27:45] Starting 'all'...
[14:27:45] Starting 'task'...
[14:27:45] Starting 'js-langs'...
[14:27:45] Finished 'task' after 8.53 ms
[14:27:45] Starting 'webpack'...
events.js:141
throw er; // Unhandled 'error' event
^
Error: spawn php artisan vue-i18n:generate ENOENT
at exports._errnoException (util.js:870:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
at onErrorNT (internal/child_process.js:344:16)
at nextTickCallbackWith2Args (node.js:441:9)
at process._tickCallback (node.js:355:17)
at Function.Module.runMain (module.js:444:11)
at startup (node.js:136:18)
at node.js:966:3
It seems that there are a problem with Vue anyone know how to fix it?
I'm trying to find information about the error if I found it I will post it here too.
The lines inside the gulpfile that makes the error are this:
gulp.task('js-langs', shell.task([
"php artisan vue-i18n:generate",
]));
If I try to make php artisan vue-i18n:generate in terminal I get this:
Written to /home/lluisdev/www/webpage/resources/assets/js/lib/locales/vue-i18n-locales.generated.js
gulpfile
Try to replace gulp shell with exec like this :
var exec = require('child_process').exec;
gulp.task('js-langs', function (cb) {
exec('php artisan vue-i18n:generate', function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
cb(err);
});
});
And if there is some errors of version you can uninstall vue-template-compiler and reinstall it :
npm uninstall vue-template-compiler
npm install vue-template-compiler
Or you can do just :
npm update vue
Or an other way you can use this command to get you the exact version and install it for you :
npm uninstall vue-template-compiler & npm install "vue-template-compiler#$(npm list --depth=0 | awk '/vue#/{print substr($2, 5)}')"