build prod failed: spawn EACCES with ionic2 - ionic-framework

I build an hybrid app using Ionic 2.
I got a windows pc and using mac virtual box for Xcode.
I can run the app on browser and android just fine in my windows.
problem is when I'm moving to mac I'm doing the same things on node JS and I get errors.
I used those lines in the terminal
ionic start/run/emulate/build Vme2
sudo ionic start/run/emulate/build Vme2
none works
this is the error I get
> ionic-hello-world# build /Users/amitaimazliah/Desktop/Vme2
> ionic-app-scripts build
[08:38:07] ionic-app-scripts 0.0.38
[08:38:07] build prod started ...
[08:38:07] clean started ...
[08:38:07] clean finished in 3 ms
[08:38:07] copy started ...
[08:38:07] ngc started ...
[08:38:07] copy finished in 262 ms
[08:38:07] build prod failed: spawn EACCES
[08:38:07] ionic-app-script task: "build"
[08:38:07] Error: spawn EACCES
npm ERR! Darwin 14.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
npm ERR! node v6.9.1
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! ionic-hello-world# build: `ionic-app-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ionic-hello-world# build script 'ionic-app-scripts build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ionic-hello-world package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ionic-app-scripts build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ionic-hello-world
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls ionic-hello-world
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/amitaimazliah/Desktop/Vme2/npm-debug.log
Caught exception:
undefined
Mind letting us know? https://github.com/driftyco/ionic-cli/issues
[08:38:07] lint started ...
[08:38:08] tslint: src/pages/home/home.ts, line: 57
Unused method: 'setNewPhotos'
L57: private setNewPhotos()
[08:38:08] lint finished in 1.27 s
(node:2376) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: channel closed
any ideas what am I doing wrong?
thanks

You have problem when build app.Can you try use this command '
ionic hooks add
Cheer !

Related

Ionic Capcitor build Android unable to resolve dependency tree

I am receiving an error when attempting to run ionic capacitor build android (details below):
PS C:\Users\User\source\repos\imango\src> ionic capacitor build android
npm.cmd i -E #capacitor/android#latest
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: mango#0.0.1
npm ERR! Found: #capacitor/core#3.7.0
npm ERR! node_modules/#capacitor/core
npm ERR! #capacitor/core#"^3.5.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer #capacitor/core#"^4.0.0" from #capacitor/android#4.0.1
npm ERR! node_modules/#capacitor/android
npm ERR! #capacitor/android#"4.0.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\User\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User\AppData\Local\npm-cache_logs\2022-08-06T22_53_19_523Z-debug-0.log
[ERROR] An error occurred while running subprocess npm.
npm.cmd i -E #capacitor/android#latest exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
Your capacitor cli version is still set at 3.6.0 in your
devDependencies, try changing that to ^4.0.1 and clearing your
node_modules and removing your package-lock.json and run npm install
again.
Check this
Copied from her:
https://github.com/ionic-team/capacitor/issues/5812

I keep getting a postgrator-cli error on heroku npm deploy

I'm trying to deploy an app to heroku but for some reason when I run the deploy command I keep on getting this error:
rator-cli\postgrator-cli.js:143
rl.history = rl.history.slice(1);
^
TypeError: Cannot read property 'slice' of undefined
at C:\Users\Zackr\Documents\node\noteful-exercise\noteful-server\node_modules\postgrator-cli\postgrator-cli.js:143:33
at Interface._onLine (readline.js:327:5)
at Interface._normalWrite (readline.js:474:12)
at Socket.ondata (readline.js:186:10)
at Socket.emit (events.js:315:20)
at addChunk (_stream_readable.js:295:12)
at readableAddChunk (_stream_readable.js:271:9)
at Socket.Readable.push (_stream_readable.js:212:10)
at Pipe.onStreamRead (internal/stream_base_commons.js:186:23)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! noteful-server#1.0.0 migrate: `postgrator --config postgrator-config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the noteful-server#1.0.0 migrate 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\Zackr\AppData\Roaming\npm-cache\_logs\2021-01-04T22_04_36_447Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! noteful-server#1.0.0 migrate:production: `env SSL=true DATABASE_URL=$postgres://rwdhntkhuroptu:48522106b9f5aaf0890905df7abe67c75710e00aba50b80edcf01a07d5cbe918#ec2-52-203-49-58.compute-1.amazonaws.com:5432/dcgq78oje0lmb6 npm run migrate`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the noteful-server#1.0.0 migrate:production 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\Zackr\AppData\Roaming\npm-cache\_logs\2021-01-04T22_04_36_547Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! noteful-server#1.0.0 postdeploy: `npm run migrate:production`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the noteful-server#1.0.0 postdeploy 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\Zackr\AppData\Roaming\npm-cache\_logs\2021-01-04T22_04_36_614Z-debug.log
The scripts for my package.json is:
"scripts": {
"test": "mocha --require test/setup.js",
"dev": "nodemon src/server.js",
"migrate": "postgrator --config postgrator-config.js",
"migrate:test": "env NODE_ENV=test npm run migrate",
"migrate:production": "env SSL=true DATABASE_URL=$(heroku config:get DATABASE_URL) npm run migrate",
"start": "node src/server.js",
"predeploy": "npm audit && npm run migrate:production",
"deploy": "git push heroku main"
},
I have the connection string and url for the database and the normal migration worked until I changed the url to the heroku URL instead of my local host server.
Node.js 6 was end-of-lifed in April 2018. It has known security vulnerabilities and most libraries don't support it. Update to at least Node.js 10.x, and preferably 14.x.
Current version of postgrator-cli is 4.0.0 and it explicitly doesn't support Node.js prior to 10.x. The last version of postgrator-cli to support Node.js 6.x was postgrator-cli 3.2.0, published in September 2019. So if you cannot upgrade Node.js, another option is to downgrade postgrator-cli to 3.2.0.

vscode.d.ts could not be installed

when I tried to run vscode-install, it would fail to sync vscode.d.ts. The problem seems random, most of our machines could not success, but two of our machines could success.
The error information is as follows:
Detected VS Code engine version: ^1.23.0
Error installing vscode.d.ts: Error: read ECONNRESET
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! lispvsext#0.0.1 postinstall: `vscode-install && node ./node_modules/vscode/bin/install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the lispvsext#0.0.1 postinstall 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\*\AppData\Roaming\npm-cache\_logs\2019-02-15T09_28_45_624Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! lispvsext#1.0.8 postinstall: `cd extension && npm install && cd ..`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the lispvsext#1.0.8 postinstall 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\*\AppData\Roaming\npm-cache\_logs\2019-02-15T09_28_45_805Z-debug.log
I had a similar problem, where the VSCode engine in package.json was very old (1.32.0) compared to the current VSCode version (1.64.2). I just updated the engine to the same as my VSCode version in package.json:
"engines": {
"vscode": "^1.64.2"
},
and the tests runner proceeds instead of erroring as before.
Unfortunately, I then got another error:
Error: Running extension tests from the command line is currently only supported if no other instance of Code is running.
which is a different problem and a limitation of VSCode at the moment (1.64.2), though there is a workaround for that.

ionic 2/3 build fail

I need help, I can not build my app, I get the following error:
[19:09:38] typescript: src/pages/sidemenu/sidemenu.ts, line: 24
[19:09:38] typescript: src/pages/sidemenu/sidemenu.ts, line: 25
[19:09:38] ionic-app-script task: "build"
[19:09:38] Error: Failed to transpile program
Error: Failed to transpile program
at new BuildError (/usr/src/app/node_modules/#ionic/app-scripts/dist/util/errors.js:16:28)
at /usr/src/app/node_modules/#ionic/app-scripts/dist/transpile.js:137:20
at Promise ()
at transpileWorker (/usr/src/app/node_modules/#ionic/app-scripts/dist/transpile.js:103:12)
at Object.transpile (/usr/src/app/node_modules/#ionic/app-scripts/dist/transpile.js:61:12)
at buildProject (/usr/src/app/node_modules/#ionic/app-scripts/dist/build.js:97:78)
at /usr/src/app/node_modules/#ionic/app-scripts/dist/build.js:47:16
at
npm info lifecycle payman#0.0.1~build: Failed to exec build script
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! payman#0.0.1 build: `ionic-app-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the payman#0.0.1 build script.
This is probably not a problem with npm. There is likely additional logging output above.
can anybody help me please??
Happens most of the time because of the version of #ionic/app-scripts try to remove the package and add it again using npm

Can not create ionic 2 app

I am following the ionic installation guide, but when I want to create app it give me error.
The command I enter is:
ionic start cutePuppyPics --v2
The error it gives is:
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files (x86)\\Nodist\\v\\nodev7.0.0\\node.exe" "C:\\Program Files (x86)\\Nodist\\bin\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v7.0.0
npm ERR! npm v3.10.6
npm ERR! code ELIFECYCLE
npm ERR! node-sass#3.9.3 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#3.9.3 postinstall script 'node scripts/build.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node scripts/build.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs node-sass
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls node-sass
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! E:\nodeProjects\ionic\cutePuppyPics\npm-debug.log
Error with start undefined
Error Initializing app: There was an error with the spawned command: npminstall
There was an error with the spawned command: npminstall
Caught exception:
undefined
Mind letting us know? https://github.com/driftyco/ionic-cli/issues
Node v7.0.0 causes this problem. Instead of nodejs v7.0.0 use nodejs v6.9.1 or install LTS version of node from https://nodejs.org/en/download
You don't have to use --v2 when creating your project. Just type
ionic start cutePuppyPics blank
--v2 is not working with latest ionic. you can use
ionic start cutePuppyPics ionic-angular (for ionic 2.x)
ionic start cutePuppyPics ionic1 (ionic 1.x)