Error while trying to run 'npm start' - node.js

I am getting the below error while trying to run npm start without updating the node version nor the npm version.
ERROR
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Work\node-v6.10.3-win-x64\node-v6.10.3-win-x64\node.exe" "
C:\Work\node-v6.10.3-win-x64\node-v6.10.3-win-x64\node_modules\npm\bin\np
m-cli.js" "start"
npm ERR! node v6.10.3
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! ucps-online-client#1.0.0 start: ng serve --proxy-config proxy.conf.jso
n
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ucps-online-client#1.0.0 start script 'ng serve --proxy-c
onfig proxy.conf.json'.
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 ucps-online-client pa
ckage,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ng serve --proxy-config proxy.conf.json
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ucps-online-client
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls ucps-online-client
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Work\workspace_Nov9_commit\ucps-online-parent\ucps-online-client
\npm-debug.log
Package.json
{
"name": "ucps-online-client",
"version": "1.0.0",
"private": true,
"license": "MIT",
"angular-cli": {},
"scripts": {
"ng": "ng",
"start": "ng serve --proxy-config proxy.conf.json",
"lint": "ng lint"
},
"dependencies": {
"#angular/animations": "^4.0.1",
"#angular/common": "^4.0.0",
"#angular/compiler": "^4.0.0",
"#angular/core": "^4.0.0",
"#angular/forms": "^4.0.0",
"#angular/http": "^4.0.0",
"#angular/platform-browser": "^4.0.0",
"#angular/platform-browser-dynamic": "^4.0.0",
"#angular/router": "^4.0.0",
"bootstrap": "3.3.7",
"core-js": "^2.4.1",
"font-awesome": "4.6.3",
"jquery": "2.2.3",
"latest-version": "^3.1.0",
"moment": "2.17.1",
"ng2-bootstrap": "1.6.3",
"ng2-datepicker": "^1.8.3",
"ng2-datetime-picker": "^0.12.5",
"ng2-pagination": "^2.0.2",
"primeng": "4.1.0",
"rxjs": "^5.0.1",
"ts-helpers": "^1.1.1",
"zone.js": "^0.8.5"
},
"devDependencies": {
"#angular/compiler-cli": "^4.0.0",
"#types/node": "^7.0.12",
"#angular/cli": "^1.0.0",
"codelyzer": "^2.1.1",
"ts-node": "^3.0.2",
"tslint": "^5.0.0",
"typescript": "^2.2.2"
},
"engines": {
"node": ">= 6.9.1",
"npm": ">= 3"
}
}

Related

After removing node_modules folder and later running npm isntall throws error

For a fresh installation, I have removed the node_modules folder using the command rm -rf node_modules/.Then from the terminal I have run npm install in Ubuntu, but now i am getting below error, could someone please advise on what steps should I follow to fix this issue ?
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: #badeball/cypress-cucumber-preprocessor#11.4.0
npm ERR! Found: esbuild#0.15.10
npm ERR! node_modules/esbuild
npm ERR! dev esbuild#"^0.15.10" from the root project
npm ERR! peer esbuild#"*" from #bahmutov/cypress-esbuild-preprocessor#2.1.5
npm ERR! node_modules/#bahmutov/cypress-esbuild-preprocessor
npm ERR! dev #bahmutov/cypress-esbuild-preprocessor#"^2.1.5" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional esbuild#"^0.14.23" from #badeball/cypress-cucumber-preprocessor#11.4.0
npm ERR! node_modules/#badeball/cypress-cucumber-preprocessor
npm ERR! #badeball/cypress-cucumber-preprocessor#"^11.4.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: esbuild#0.14.54
npm ERR! node_modules/esbuild
npm ERR! peerOptional esbuild#"^0.14.23" from #badeball/cypress-cucumber-preprocessor#11.4.0
npm ERR! node_modules/#badeball/cypress-cucumber-preprocessor
npm ERR! #badeball/cypress-cucumber-preprocessor#"^11.4.0" 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 /home/den/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/den/.npm/_logs/2022-10-15T03_40_29_742Z-debug-0.log
// package.json
{
"name": "booktest",
"version": "1.0.0",
"description": "",
"main": "index.js",
"repository": {
"type": "git",
"url": "https://someurl.com"
},
"author": "BookTest",
"license": "UNLICENSED",
"private": true,
"scripts": {
"remove-files": "node removeFiles.js",
"cucumber-report": "node createreport.js",
"cypress:open": "cypress open",
"cy:simpro-run": "cypress run && npm run cucumber-report",
"cy:rest-api": "cypress run --headless --spec tests/cypress/integration/restapi/**/*.spec.js"
},
"devDependencies": {
"#babel/core": "^7.13.8",
"#babel/polyfill": "^7.12.1",
"#babel/preset-env": "^7.13.9",
"#bahmutov/cypress-esbuild-preprocessor": "^2.1.5",
"cheerio": "^1.0.0-rc.5",
"cucumber-html-reporter": "^5.3.0",
"cypress": "^10.10.0",
"cypress-dotenv": "^1.2.2",
"cypress-file-upload": "^4.1.1",
"cypress-localstorage-commands": "^1.4.1",
"cypress-wait-until": "^1.7.1",
"esbuild": "^0.15.10",
"eslint": "^6.8.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react": "^7.22.0",
"fs-extra": "^8.1.0",
"gulp": "^4.0.2",
"gulp-autoprefixer": "^7.0.1",
"gulp-babel": "^8.0.0",
"gulp-concat": "^2.6.1",
"gulp-debug": "^4.0.0",
"gulp-eslint": "^6.0.0",
"gulp-filter": "^6.0.0",
"gulp-fs-cache": "^0.1.0",
"gulp-iconfont": "^10.0.3",
"gulp-if": "^3.0.0",
"gulp-livereload": "^4.0.2",
"gulp-order": "^1.2.0",
"gulp-sass": "^4.1.0",
"gulp-sourcemaps": "^2.6.5",
"gulp-terser": "^1.4.1",
"gulp-wait": "0.0.2",
"lazypipe": "^1.0.2",
"merge-stream": "^2.0.0",
"node-sass": "^4.14.1"
},
"browserslist": [
"last 2 Chrome versions",
"last 2 Firefox versions",
"last 2 Safari versions",
"last 2 Edge versions",
"IE 11",
"last 2 ChromeAndroid versions",
"last 2 iOS versions",
"last 2 Samsung versions",
"last 2 FirefoxAndroid versions"
],
"dependencies": {
"#badeball/cypress-cucumber-preprocessor": "^11.4.0",
"#cypress/webpack-preprocessor": "^5.14.0",
"auth0-js": "^9.14.3",
"dotenv": "^8.2.0",
"idb": "^6.0.0",
"moment": "^2.29.1",
"papaparse": "^5.3.0",
"path": "^0.12.7",
"pdf-parse": "^1.1.1",
"pdfjs-dist": "^2.6.347"
}
}
The problem looks like a mis-match of versions, although I couldn't reproduce the same error message.
If you download the #badeball/cypress-cucumber-preprocessor repository file, unzip it and copy the example folder that most closely matches your current setup - looks like /esbuild-cjs is the closest.
If you use that folder as the project root (rename it whatever you want) and npm install to set up node-modules, then look in the node-module folder you will see these versions have been installed.
"cypress": "10.10.0",
"#badeball/cypress-cucumber-preprocessor": "#13.0.2",
"#bahmutov/cypress-esbuild-preprocessor": "#2.1.5"
"esbuild": '0.14.54',
which is fairly close to the recommendation in the error message.
The package.json just has
{
"devDependencies": {
"#badeball/cypress-cucumber-preprocessor": "latest",
"#bahmutov/cypress-esbuild-preprocessor": "latest",
"cypress": "latest"
}
}
If you want you can change latest to the specific versions, and add the other packages you need,
but don't add the entry for esbuild because it's correct version is already being installed by #badeball/cypress-cucumber-preprocessor.
Any additions you make to dependencies or devDependencies, you will need to run npm install to update node-modules.

Why i receive error message while install typeorm?

I tried to build my project with Jenkins.
Node version: 16.16.0
Npm version: 8.11.0
Env: Ubuntu 20.04.4 LTS
Jenkins pulled git repo and tried to install dependencies.
I installed nodejs plugin to jenkins.
If i tried run npm i manually from /var/lib/jenkins/workspace it shows me same error log.
npm i working correctly on my local machine (Windows 10)
Also i tried to re-install node and npm with versions from my local machine, but nothing happened :(
My error log:
00:07:51 npm ERR! code ERESOLVE
00:07:51 npm ERR! ERESOLVE could not resolve
00:07:51 npm ERR!
00:07:51 npm ERR! While resolving: #nestjs/typeorm#8.0.3
00:07:51 npm ERR! Found: typeorm#0.3.6
00:07:51 npm ERR! node_modules/typeorm
00:07:51 npm ERR! typeorm#"^0.3.6" from the root project
00:07:51 npm ERR!
00:07:51 npm ERR! Could not resolve dependency:
00:07:51 npm ERR! peer typeorm#"^0.2.34" from #nestjs/typeorm#8.0.3
00:07:51 npm ERR! node_modules/#nestjs/typeorm
00:07:51 npm ERR! #nestjs/typeorm#"^8.0.3" from the root project
00:07:51 npm ERR!
00:07:51 npm ERR! Conflicting peer dependency: typeorm#0.2.45
00:07:51 npm ERR! node_modules/typeorm
00:07:51 npm ERR! peer typeorm#"^0.2.34" from #nestjs/typeorm#8.0.3
00:07:51 npm ERR! node_modules/#nestjs/typeorm
00:07:51 npm ERR! #nestjs/typeorm#"^8.0.3" from the root project
00:07:51 npm ERR!
00:07:51 npm ERR! Fix the upstream dependency conflict, or retry
00:07:51 npm ERR! this command with --force, or --legacy-peer-deps
00:07:51 npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
00:07:51 npm ERR!
00:07:51 npm ERR! See /var/lib/jenkins/.npm/eresolve-report.txt for a full report.
00:07:51
00:07:51 npm ERR! A complete log of this run can be found in:
00:07:51 npm ERR! /var/lib/jenkins/.npm/_logs/2022-07-20T21_07_43_903Z-debug-0.log
package.json file:
{
"name": "teach-me-grow",
"version": "0.0.1",
"description": "",
"author": "",
"private": true,
"license": "UNLICENSED",
"scripts": {
"prebuild": "rimraf dist",
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json"
},
"dependencies": {
"#nestjs/common": "^8.0.0",
"#nestjs/core": "^8.0.0",
"#nestjs/passport": "^8.2.1",
"#nestjs/platform-express": "^8.0.0",
"#nestjs/swagger": "^5.2.1",
"#nestjs/typeorm": "^8.0.3",
"class-validator": "^0.13.2",
"connect-typeorm": "^1.1.4",
"dotenv": "^16.0.1",
"express-session": "^1.17.3",
"module-alias": "^2.2.2",
"passport": "^0.5.3",
"passport-facebook": "^3.0.0",
"passport-google-oauth20": "^2.0.0",
"passport-local": "^1.0.0",
"pg": "^8.7.3",
"pg-hstore": "^2.3.4",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"rxjs": "^7.2.0",
"swagger-ui-express": "^4.4.0",
"typeorm": "^0.3.6"
},
"devDependencies": {
"#nestjs/cli": "^8.0.0",
"#nestjs/schematics": "^8.0.0",
"#nestjs/testing": "^8.0.0",
"#types/express": "^4.17.13",
"#types/jest": "27.5.0",
"#types/node": "^16.0.0",
"#types/supertest": "^2.0.11",
"#typescript-eslint/eslint-plugin": "^5.0.0",
"#typescript-eslint/parser": "^5.0.0",
"eslint": "^8.0.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"jest": "28.0.3",
"prettier": "^2.3.2",
"source-map-support": "^0.5.20",
"supertest": "^6.1.3",
"ts-jest": "28.0.1",
"ts-loader": "^9.2.3",
"ts-node": "^10.0.0",
"tsconfig-paths": "4.0.0",
"typescript": "^4.3.5"
},
"jest": {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": "src",
"testRegex": ".*\\.spec\\.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"collectCoverageFrom": [
"**/*.(t|j)s"
],
"coverageDirectory": "../coverage",
"testEnvironment": "node"
},
"_moduleAliases": {
"#app": "./dist"
}
}
Looking on nestjs/typeorm in version 8.0.3 it has fixed version of typeorm package in its dependencies (package.json: https://github.com/nestjs/typeorm/blob/8.0.3/package.json)
If you want to stick to nestjs/typeorm 8.0.3 version lower your typeorm version to 0.2.45 or upgrade nestjs/typeorm version to one which uses newer typeorm version

Could not resolve peer dependency between my Angular app and my custom Angular library

I have created this Angular library that I now want to use in my other Angular apps, but I seem to have trouble with my peer dependencies. I have tried fiddling around in my App's package.json, but couldn't seem to remove any of my errors.
What I have tried (in that order) :
Removing node_modules
ng update
npm update
npm audit --fix
npm i
Recreating a new test app all together
Here are the errors :
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: lib-test#0.0.0
npm ERR! Found: #angular/common#13.0.3
npm ERR! node_modules/#angular/common
npm ERR! #angular/common#"~13.0.0" from the root project
npm ERR! peer #angular/common#"^13.0.0 || ^14.0.0-0" from #angular/cdk#13.2.2
npm ERR! node_modules/#angular/cdk
npm ERR! #angular/cdk#"^13.2.0" from the root project
npm ERR! peer #angular/cdk#"^13.0.0" from #my-group/angular-lib#1.1.4
npm ERR! node_modules/#my-group/angular-lib
npm ERR! #my-group/angular-lib#"*" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer #angular/common#"^13.1.0" from #my-group/angular-lib#1.1.4
npm ERR! node_modules/#my-group/angular-lib
npm ERR! #my-group/angular-lib#"*" 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.
package.json (App)
{
"name": "lib-test",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"private": true,
"dependencies": {
"#angular/animations": "~13.0.0",
"#angular/cdk": "^13.2.2",
"#angular/common": "~13.0.0",
"#angular/compiler": "~13.0.0",
"#angular/core": "~13.0.0",
"#angular/forms": "~13.0.0",
"#angular/material": "^13.2.2",
"#angular/platform-browser": "~13.0.0",
"#angular/platform-browser-dynamic": "~13.0.0",
"#angular/router": "~13.0.0",
"#cloud-republic/angular-lib": "^1.1.4",
"rxjs": "~7.4.0",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"#angular-devkit/build-angular": "~13.0.3",
"#angular/cli": "~13.0.3",
"#angular/compiler-cli": "~13.0.0",
"#types/jasmine": "~3.10.0",
"#types/node": "^12.11.1",
"jasmine-core": "~3.10.0",
"karma": "~6.3.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "~1.7.0",
"typescript": "~4.4.3"
}
}
package.json (Library)
{
"name": "#my-group/angular-lib",
"version": "1.0.6",
"publishConfig": {
"#my-group:registry": "https://gitlab.com/api/v4/projects/XXXXXX/packages/npm/"
},
"scripts": {
"build-lib": "ng build lib-angular",
"semantic-release": "semantic-release"
},
"peerDependencies": {
"#angular/cdk": "^13.0.0",
"#angular/common": "^13.1.0",
"#angular/core": "^13.1.0",
"#angular/material": "^13.2.0",
"ngx-bootstrap": "^8.0.0",
"rxjs": "~7.4.0"
},
"dependencies": {
"tslib": "^2.3.0"
},
"devDependencies": {
"#semantic-release/gitlab": "^7.0.4",
"semantic-release": "^19.0.2"
}
}
Thanks in advance
This is not the issue with peer dependencies. This is more to do with version conflict. I guess you are using npm >=7 that's why you are getting this error:-
As mentioned in the error log try the below command to fix the issue:-
npm install --legacy-peer-deps
The above solution will solve your problem. However, the main issue is with your library.
In your library package you are saying use the below package:-
"#angular/common": "^13.1.0"
However, in your application, you have installed the below version.
"#angular/common": "~13.0.0".
So your library package is greater than the one installed in the application.
Either install the same version in your application or downgrade the version in your library.
In this way, npm install command will work without any issue.

node-gyp-build not found when Deploying web3 App to heroku

I'm attempting to deploy a web3 application to heroku, but while building the npm dependencies, I get the following error:
remote: sh: 1: node-gyp-build: not found
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! syscall spawn
remote: npm ERR! file sh
remote: npm ERR! errno ENOENT
remote: npm ERR! bufferutil#4.0.3 install: `node-gyp-build`
remote: npm ERR! spawn ENOENT
remote: npm ERR!
remote: npm ERR! Failed at the bufferutil#4.0.3 install script.
I believe this is because of the web3#1.3.6 dependency I am adding. If I leave this out of the npm dependencies in my package.json file, the deploy works successfully.
If I ssh into a console, I'm able to run npm install -g web3#1.3.6 and that is also successful. I've also tried adding node-gyp, node-gyp-build, and bufferutil as explicit dependencies in the package.json file. I'm using
node 14.17.0
npm 6.14.13
python 3.9.5
Below is my full package.json file
{
"engines": {
"node": "14.17.0",
"npm": "6.14.13"
},
"repository": {},
"description": " ",
"license": "MIT",
"scripts": {
"deploy": "webpack --mode production",
"watch": "webpack --mode development --watch"
},
"dependencies": {
"postcss": "8.1.0",
"#popperjs/core": "^2.9.2",
"bootstrap": "^5.0.1",
"jquery": "^3.6.0",
"phoenix": "file:../deps/phoenix",
"phoenix_html": "file:../deps/phoenix_html",
"phoenix_live_view": "file:../deps/phoenix_live_view",
"topbar": "^0.1.4",
"#babel/core": "^7.0.0",
"babel-polyfill": "^6.26.0",
"#babel/preset-env": "^7.0.0",
"babel-loader": "^8.0.0",
"css-loader": "^5.2.6",
"sass-loader": "^10.0.0",
"node-sass": "^6.0.0",
"cropperjs": "1.5.12",
"eth-sig-util": "^1.4.2",
"jquery-cropper": "1.0.1",
"copy-webpack-plugin": "^5.1.1",
"hard-source-webpack-plugin": "^0.13.1",
"mini-css-extract-plugin": "^0.9.0",
"optimize-css-assets-webpack-plugin": "^5.0.1",
"terser-webpack-plugin": "^2.3.2",
"webpack": "^4.41.5",
"webpack-cli": "^3.3.2",
"web3": "1.3.6"
},
"devDependencies": {},
}

Package is not working angular 2

I am new to angular2 and I have problem with angular 2 package. I have been trying to fix the problem and I couldn't. I am doing some assignment/project and the teacher provide with package.json with assignment. I install npm in locally on project folder as well as globally, but I couldn't start local server. I am running the program at window. The problem is here, when I run npm start or npm start -server I got the following error:
npm ERR! node v6.9.2
npm ERR! npm v2.12.1
npm ERR! code ELIFECYCLE
npm ERR! angular2-boilerplate#1.0.0 start: `gulp`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular2-boilerplate#1.0.0 start script 'gulp'.
npm ERR! This is most likely a problem with the angular2-boilerplate package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! gulp
npm ERR! You can get their info via:
npm ERR! npm owner ls angular2-boilerplate
npm ERR! There is likely additional logging output above.
package.json file is
{
"name": "angular2-boilerplate",
"version": "1.0.0",
"scripts": {
"start": "gulp",
"gulp": "gulp",
"watch": "gulp watch",
"clean": "gulp clean",
"typings": "typings",
"postinstall": "typings install"
},
"license": "MIT",
"dependencies": {
"#angular/common": "2.0.0-rc.1",
"#angular/compiler": "2.0.0-rc.1",
"#angular/core": "2.0.0-rc.1",
"#angular/http": "2.0.0-rc.1",
"#angular/platform-browser": "2.0.0-rc.1",
"#angular/platform-browser-dynamic": "2.0.0-rc.1",
"#angular/router": "2.0.0-rc.1",
"#angular/router-deprecated": "2.0.0-rc.1",
"#angular/upgrade": "2.0.0-rc.1",
"systemjs": "0.19.27",
"es6-shim": "^0.35.0",
"reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.6",
"zone.js": "^0.6.12"
},
"devDependencies": {
"babel-core": "^6.0.15",
"babel-preset-es2015": "^6.0.15",
"browser-sync": "^2.10.1",
"del": "^2.0.0",
"gulp": "^3.9.0",
"gulp-autoprefixer": "^3.1.0",
"gulp-concat": "^2.6.0",
"gulp-concat-css": "^2.2.0",
"gulp-inline-ng2-template": "^1.1.2",
"gulp-minify-css": "^1.2.1",
"gulp-typescript": "^2.10.0",
"gulp-watch": "^4.3.5",
"stream-series": "^0.1.1",
"typescript": "^1.7.3",
"typings":"^0.6.8",
"systemjs-builder": "^0.15.15"
}
}

Resources