Npm failure for the ionic project creation - ionic-framework

ionic start my-app tabs --capacitor
Pick a framework!
Please select the JavaScript framework to use for your new app. To bypass this prompt next time, supply a value for the
--type option.
? Framework: React
√ Preparing directory .\my-app in 2.24ms
√ Downloading and extracting tabs starter in 325.63ms
ionic integrations enable capacitor --quiet -- my-app io.ionic.starter
npm.cmd i --save -E #capacitor/core
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: ionic-app-base#0.1.0
npm ERR! Found: typescript#4.1.3
npm ERR! node_modules/typescript
npm ERR! typescript#"4.1.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional typescript#"^3.2.1" from react-scripts#4.0.1
npm ERR! node_modules/react-scripts
npm ERR! react-scripts#"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\sowmyans\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\sowmyans\AppData\Local\npm-cache_logs\2021-02-03T21_23_15_246Z-debug.log
[ERROR] An error occurred while running subprocess npm.
npm.cmd i --save -E #capacitor/core exited with exit code 1.
npm resolution error report
2021-02-03T20:47:47.168Z
Found: typescript#4.1.3
node_modules/typescript
typescript#"4.1.3" from the root project
Could not resolve dependency:
peerOptional typescript#"^3.2.1" from react-scripts#4.0.1
node_modules/react-scripts
react-scripts#"4.0.1" from the root project
Fix the upstream dependency conflict, or retry
this command with --force, or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.
Raw JSON explanation object:
{
"code": "ERESOLVE",
"current": {
"name": "typescript",
"version": "4.1.3",
"location": "node_modules/typescript",
"dependents": [
{
"type": "prod",
"name": "typescript",
"spec": "4.1.3",
"from": {
"location": "C:\Users\[user]\\source\repos\ionic\my-app"
}
}
]
},
"edge": {
"type": "peerOptional",
"name": "typescript",
"spec": "^3.2.1",
"error": "INVALID",
"from": {
"name": "react-scripts",
"version": "4.0.1",
"location": "node_modules/react-scripts",
"dependents": [
{
"type": "prod",
"name": "react-scripts",
"spec": "4.0.1",
"from": {
"location": "C:\Users\[user]\source\repos\ionic\my-app
}
}
]
}
},
"peerConflict": null,
"strictPeerDeps": false,
"force": false
}

I have faced the same problem in the past. I could only resolve it by manually deleting the dependencies that he was about one by one from the global node_modules folder. Whenever, I would delete one package, it would tell me there is a conflict in another package as well which I kept on deleting and at the end I got the application up and running.

Related

how to solve this issue connection_string.ts in nodeModule and run npm install?

I am trying to run npm install so I can do yarn start to deploy the project to AWS but it gives me an error. Anyone here can help me understand what is going on and how to solve it?
this is image for problems I have to this issue:
https://drive.google.com/file/d/1sgxCvaVa-mR7HBb3G8o1PU8pi3dydjS3/view?usp=sharing
The Error output here:
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /Users/youmnasalloum/.npm/_cacache/tmp/git-cloneG2Tj0m/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/Users/youmnasalloum/.npm/_cacache/tmp/git-cloneG2Tj0m/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/youmnasalloum/.npm/_logs/2022-04-04T10_05_54_917Z-debug-0.log
The package.json content here:
{
"name": "user",
"version": "1.0.0",
"main": "index.ts",
"repository": "https://github.com/ArtistCrowdfundExchange/user",
"author": "Oghogho Odemwingie",
"license": "MIT",
"devDependencies": {
"#types/bcrypt": "^3.0.0",
"#types/node": "^17.0.13",
"typescript": "4.5.5"
},
"scripts": {
"start": "ts-node index.ts",
"test": "echo no tests yet"
},
"dependencies": {
"#aws-sdk/client-s3": "^3.41.0",
"#grpc/grpc-js": "^1.3.7",
"aws4": "^1.11.0",
"bcrypt": "^5.0.0",
"cuid": "^2.1.8",
"jose": "3",
"mongodb": "^4.4.1",
"mongodb-connection-string-url": "^2.5.2",
"mongojs": "^3.1.0",
"mongoose": "6.1.8",
"nanoid": "^3.1.29",
"next-auth": "^4.3.1",
"proto": "git+https://github.com/ArtistCrowdfundExchange/proto#playground",
"ts-node": "^10.4.0",
"winston": "^3.3.3"
}
}

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.

How to deploy npm project to gh-pages

I'm trying to deploy a website to gh-pages using npm. I'm using blain HTML and CSS and asynchronous javascript. I haven't used any SPA framework (react or angular).
I'm currently using lite server for development purposes and gh-pages package.
I'm trying to deploy the src folder using the following command
npm run deploy
it fails because the build script is not specified.
my question is what should I write in the build script?
when I try to run npm run deploy it displays the following error
'src' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! AmrAhmed#1.0.0 build: `src`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the AmrAhmed#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! C:\Users\Amr\AppData\Roaming\npm-cache\_logs\2020-05-30T11_30_29_824Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! AmrAhmed#1.0.0 predeploy: `npm run build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the AmrAhmed#1.0.0 predeploy 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\Amr\AppData\Roaming\npm-cache\_logs\2020-05-30T11_30_29_869Z-debug.log
in similar projects using react, the build script has the following react-scripts build
this is my package.json file
{
"name": "AmrAhmed",
"version": "1.0.0",
"description": "",
"main": "truffle.js",
"directories": {
"test": "test"
},
"scripts": {
"dev": "lite-server",
"test": "echo \"Error: no test specified\" && exit 1",
"build": "src",
"predeploy": "npm run build",
"deploy": "gh-pages -d src"
},
"author": "",
"license": "ISC",
"devDependencies": {
"gh-pages": "^3.0.0",
"lite-server": "^2.5.4"
}
}
election folder content
src folder content
I found out that you don't need the build script or the pre-deploy script. they are unnecessary to be used, since my website is static, I can navigate directly to the build folder and it will work fine.
I have modified the config.json file to be as in the following
{
"name": "AmrAhmed",
"version": "1.0.0",
"description": "",
"main": "truffle.js",
"directories": {
"test": "test"
},
"scripts": {
"dev": "lite-server",
"test": "echo \"Error: no test specified\" && exit 1",
"deploy": "gh-pages -d src"
},
"author": "",
"license": "ISC",
"devDependencies": {
"gh-pages": "^3.0.0",
"lite-server": "^2.5.4"
}
}
run the command
npm run build
and it will be deployed to Github pages.
you should also add "homepage":"https://yourGithub.github.io/your-repo" above "name" in the package.json

npm run build error for bootstrap4 UI Framework Web project

Please I need some help here.
After I type npm run build to my terminal of windows 10, I get the following errors:
'imagemin' is not recognized as an internal or external command,
operable program or batch file. npm ERR! code ELIFECYCLE npm ERR!
errno 1 npm ERR! confusion#1.0.0 imagemin: imagemin img/* -o
dist/img npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the
confusion#1.0.0 imagemin 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\ndunga\AppData\Roaming\npm-cache_logs\2017-10-19T16_46_04_328Z-debug.log
npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! confusion#1.0.0
build: npm run clean && npm run copyfonts && npm run imagemin && npm
run usemin npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the
confusion#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!
C:\Users\ndunga\AppData\Roaming\npm-cache_logs\2017-10-19T16_46_04_381Z-debug.log
Here is my package.json file
{
"name": "confusion",
"version": "1.0.0",
"description": "This is a website for Ristorante Con Fusion",
"main": "index.html",
"scripts": {
"start": "npm run watch:all",
"test": "echo \"Error: no test specified\" && exit 1",
"lite": "lite-server",
"scss": "node-sass -o css/ css/",
"watch:scss": "onchange \"css/*.scss\" -- npm run scss",
"watch:all": "parallelshell \"npm run watch:scss\" \"npm run lite\"",
"clean": "rimraf dist",
"copyfonts": "copyfiles -f node_modules/font-awesome/fonts/* dist/fonts",
"imagemin": "imagemin img/* -o dist/img",
"usemin": "usemin contactus.html -d dist --htmlmin -o dist/contactus.html && usemin aboutus.html -d dist --htmlmin -o dist/aboutus.html && usemin index.html -d dist --htmlmin -o dist/index.html",
"build": "npm run clean && npm run copyfonts && npm run imagemin && npm run usemin"
},
"author": "",
"license": "ISC",
"devDependencies": {
"cssmin": "^0.4.3",
"htmlmin": "0.0.7",
"lite-server": "^2.2.2",
"node-sass": "^4.5.3",
"onchange": "^3.2.1",
"parallelshell": "^3.0.2",
"rimraf": "^2.6.2",
"uglifyjs": "^2.4.11",
"usemin-cli": "^0.5.1"
},
"dependencies": {
"bootstrap": "^4.0.0-alpha.6",
"font-awesome": "^4.7.0"
}
}
You don't have imagemin package installed.
npm install imagemin --save
install imagemin-cli and use it like "imagemin": "imagemin img/ --out-dir=dist/img" in package.json
This works for me (Windows 10):
Open index.js file (path: \Bootstrap4\conFusion\node_modules\parallelshell\index.js)
At line 105, instead of "cwd: process.versions.node", change to "cwd: parseInt(process.versions.node)"

Installing node http-proxy

I am trying to install node http-proxy with the following:
npm install http-proxy
But I get this error:
npm ERR! Unsupported
npm ERR! Not compatible with your version of node/npm: http-proxy#0.5.7
npm ERR! Required: {"node":"= 0.4.7"}
npm ERR! Actual: {"npm":"1.0.6","node":"v0.5.0-pre"}
npm ERR!
npm ERR! System Linux 2.6.18-028stab070.14
npm ERR! command "node" "/usr/local/bin/npm" "install" "http-proxy"
It says that it is unsupported with my version of Node.js. But I have v0.5.0 installed which is above the necessary v0.4.7.
Is node http-proxy only compatible with v0.4.7? Any ideas?
I'd assume it's because the package.json for that module specifies a specific version of node ("engines": { "node": "= 0.4.7" }) as opposed to saying (>= 0.4.7). By contrast, the package.json for connect says "engines": { "node": ">= 0.4.1 < 0.5.0" }