There is a public repository on github with its corresponding package on npm, both are public. In previous buildings, a GitHub Action was publishing the package every time a new commit was merged on main branch.
The issue now is that the workflow is not working because npm install fails since it is asking for authentication.
This is the error stack:
Run npm install
npm ERR! code E401
npm ERR! Incorrect or missing password.
npm ERR! If you were trying to login, change your password, create an
npm ERR! authentication token or enable two-factor authentication then
npm ERR! that means you likely typed your password in incorrectly.
npm ERR! Please try again, or recover your password at:
npm ERR! https://www.npmjs.com/forgot
npm ERR!
npm ERR! If you were doing some other operation then your saved credentials are
npm ERR! probably out of date. To correct this please try logging in again with:
npm ERR! npm login
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2021-02-06T03_46_34_194Z-debug.log
Error: Process completed with exit code 1.
These are the dependencies:
"dependencies": {
"amqplib": "^0.6.0",
"body-parser": "^1.18.2",
"cors": "^2.8.4",
"express": "^4.17.1",
"express-fileupload": "^1.1.4",
"gridfs-stream": "^1.1.1",
"http-status-codes": "^2.1.4",
"moment": "^2.24.0",
"mongoose": "^5.11.8",
"multer": "^1.4.1",
"redis": "^3.0.2",
"reflect-metadata": "^0.1.10"
},
"devDependencies": {
"#commitlint/cli": "^11.0.0",
"#commitlint/config-conventional": "^11.0.0",
"#types/amqplib": "^0.5.17",
"#types/body-parser": "^1.16.7",
"#types/cors": "^2.8.3",
"#types/express": "^4.17.9",
"#types/gridfs-stream": "^0.5.30",
"#types/multer": "^1.3.7",
"#types/node": "^14.14.16",
"#types/redis": "^2.8.6",
"del": "^6.0.0",
"gulp": "^4.0.2",
"gulp-exec": "^5.0.0",
"gulp-string-replace": "^1.1.2",
"husky": "^4.3.8",
"merge-stream": "^2.0.0",
"typedoc": "^0.19.2",
"typescript": "^4.0.0"
}
Related
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.
I'm trying to install react-twitter-embed on my react app. I have tried deleting and reinstalling my node_modules folder and clearing my npm cache. I've tried upgrading my node and npm to the latest version as well.
Here's the error I'm getting:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: ant-design-pro#2.2.0
npm ERR! Found: react#17.0.2
npm ERR! node_modules/react
npm ERR! react#"^17.0.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^15.0.0 || ^16.0.0" from react-twitter-embed#3.0.3
npm ERR! node_modules/react-twitter-embed
npm ERR! react-twitter-embed#"*" 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.
Here's the list of current dependencies in my package.json
"#ant-design/icons": "^4.7.0",
"#antv/data-set": "^0.10.0",
"#apollo/client": "^3.4.11",
"#babel/runtime": "^7.2.0",
"#ethersproject/abi": "^5.4.1",
"#ethersproject/address": "^5.4.0",
"#ethersproject/bignumber": "^5.4.0",
"#ethersproject/bytes": "^5.4.0",
"#ethersproject/constants": "^5.4.0",
"#ethersproject/contracts": "^5.4.0",
"#ethersproject/providers": "^5.4.1",
"#ethersproject/solidity": "^5.4.0",
"#ethersproject/units": "^5.4.0",
"#material-ui/core": "^4.12.3",
"#web3-react/core": "^6.1.9",
"#web3-react/fortmatic-connector": "^6.1.6",
"#web3-react/injected-connector": "^6.0.7",
"#web3-react/ledger-connector": "^6.1.9",
"#web3-react/network-connector": "^6.1.9",
"#web3-react/portis-connector": "^6.1.9",
"#web3-react/torus-connector": "^6.1.9",
"#web3-react/trezor-connector": "^6.1.9",
"#web3-react/walletconnect-connector": "^6.2.6",
"#web3-react/walletlink-connector": "^6.2.6",
"accounting-js": "^1.1.1",
"antd": "^3.26.20",
"apollo-boost": "^0.4.9",
"axios": "^0.18.1",
"bizcharts": "^3.4.2",
"bizcharts-plugin-slider": "^2.1.1-beta.1",
"bootstrap": "^5.0.2",
"chalk": "^2.4.2",
"classnames": "^2.2.6",
"core-js": "^3.17.2",
"crypto-js": "^4.1.1",
"dayjs": "^1.10.7",
"echarts": "^5.2.2",
"echarts-for-react": "^3.0.1",
"enquire-js": "^0.2.1",
"graphql": "^15.5.3",
"graphql-tag": "^2.12.5",
"hash.js": "^1.1.5",
"lodash": "^4.17.10",
"lodash-decorators": "^6.0.0",
"math.js": "^1.1.46",
"memoize-one": "^5.0.0",
"moment": "^2.22.2",
"numeral": "^2.0.6",
"nzh": "^1.0.3",
"omit.js": "^1.0.0",
"only-last-promise": "^1.0.0",
"path-to-regexp": "^2.4.0",
"prop-types": "^15.7.2",
"qs": "^6.6.0",
"rc-animate": "^2.4.4",
"react": "^17.0.2",
"react-apollo": "^3.1.5",
"react-bootstrap": "^2.0.0-beta.4",
"react-click-outside": "^3.0.1",
"react-container-query": "^0.11.0",
"react-copy-to-clipboard": "^5.0.1",
"react-datepicker": "^4.2.1",
"react-detect-click-outside": "^1.1.1",
"react-device-detect": "^1.17.0",
"react-document-title": "^2.0.3",
"react-dom": "^17.0.2",
"react-fittext": "^1.0.0",
"react-media": "^1.8.0",
"react-redux": "^7.2.3",
"react-router-dom": "^4.3.1",
"redux": "^4.0.5",
"styled-components": "^5.3.3",
"web3-eth": "^1.6.0",
"web3-eth-contract": "^1.6.0",
"web3-utils": "^1.6.0"
},
As the error states, you need to have react 15 or 16 installed. Your package.json currently has react 17 instead. Change it to:
"react": "^16.0.0",
then re-run npm install.
PS: you will probably update some of the other dependencies as well then, e.g., "react-dom": "^17.0.2" probably won't work anymore.
The alternative is to write to the maintainers of the package you want and see when they think react 17 will be supported.
Update
Saurabh Nemade, the author of the package in question points out in the comments, this should no longer be necessary (nor should the describe error occur, I suppose), because react-twitter-embed now supports newer versions of react. (Thanks, Saurabh!)
you can run this command for the latest react version instead of uninstalling it
npm i react-tweet-embed
New react version is now supported with recent version of react-twitter-embed along with types.
Events will be also added sooner to the package as I am working towards making it cover all cases. :)
I've been working on a react native app, and I keep running into dependency issues. I finally ironed out my dependencies so that I can actually npm install. Now I am trying to add react-native-image-mapper, and while our app is using react 17, react-native-image-mapper wants react 16.8.3. I tried using that react version, but then all the rest of my dependencies were off. I was reading that react 17 was a "gradual" upgrade from 16, so I tried to npm i --force, but then my app would not run at all.
Here are the dependencies from package.json:
"#react-navigation/bottom-tabs": "^6.0.8",
"#react-navigation/native": "^6.0.4",
"#react-navigation/native-stack": "^6.2.2",
"#use-expo/font": "^2.0.0",
"axios": "^0.21.1",
"cloudinary": "^1.27.1",
"cors": "^2.8.5",
"dotenv": "^10.0.0",
"expo": "~42.0.1",
"expo-app-loading": "1.1.2",
"expo-camera": "^11.2.2",
"expo-font": "~9.2.1",
"expo-status-bar": "~1.0.4",
"express": "^4.17.1",
"firebase": "8.2.3",
"firebase-admin": "^9.12.0",
"morgan": "^1.9.1",
"pg": "^8.5.1",
"react": "17.0.1",
"react-native": "0.64.2",
"react-native-keyboard-aware-scroll-view": "^0.9.4",
"react-native-safe-area-context": "3.2.0",
"react-native-screens": "^3.4.0",
"react-native-select-dropdown": "^1.2.0",
"react-native-web": "^0.17.5",
"react-redux": "^7.2.4",
"redux": "^4.1.0",
"redux-devtools-extension": "^2.13.9",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0",
"sequelize": "^6.3.5",
"uuid": "^8.3.2"
},
"devDependencies": {
"#babel/core": "^7.12.10",
"#babel/preset-react": "^7.12.10",
"#babel/register": "^7.12.10",
"babel-loader": "^8.2.2",
"eslint": "^7.32.0",
"eslint-plugin-react": "^7.26.1",
"esm": "^3.2.25",
"nodemon": "^1.19.4",
"react-dom": "17.0.1"
}
Here is the error message I get when I try to add react-native-image-mapper:
npm ERR!
npm ERR! While resolving: mole-tracks#0.0.1
npm ERR! Found: react#17.0.1
npm ERR! node_modules/react
npm ERR! react#"17.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"16.8.3" from react-native-image-mapper#0.1.11
npm ERR! node_modules/react-native-image-mapper
npm ERR! react-native-image-mapper#"*" 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.
Is there any simple way to untangle problematic dependencies? Is there something glaringly wrong with our dependencies as they stand?
I'm looking for practical advice on how to solve this specific problem as well as tips for avoiding this kind of thing in the future.
Try to use this command
npm install --legacy-peer-deps
I looked at the react-native-image-mapper library and I can say that its structure is poor as a library therefore it gives you the error. If you want to use it anyway, I suggest you just copy the source code (which is only 1 page) and add it to your project as a component.
There is no need to install it because there are no native parts that exist in the code. Only JavaScript.
My docker image is running on AWS ECS. It runs for some time and then the container crashes with the following message :
Segmentation fault (core dumped)
npm ERR! code ELIFECYCLE
npm ERR! errno 139
npm ERR! fantasyservice#1.0.0 server: tsc -p . && node --max-old-space-size=1700 ./dist/server.js
npm ERR! Exit status 139
npm ERR!
npm ERR! Failed at the fantasyservice#1.0.0 server script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-07-08T07_51_00_148Z-debug.log
I found that this issue occurs when one of the libraries using C++ modules fails. My package.json has the following dependencies installed -
"dependencies": {
"#nestjs/graphql": "^6.5.3",
"#types/bull": "^3.10.6",
"#types/bull-arena": "^2.6.0",
"#types/check-types": "^7.3.1",
"#types/compression": "^1.0.1",
"#types/cors": "^2.8.6",
"#types/express": "^4.17.2",
"#types/graphql-type-json": "^0.3.2",
"#types/http-errors": "^1.6.2",
"#types/jsonwebtoken": "^8.3.5",
"#types/node": "^12.12.11",
"#types/node-fetch": "^2.5.3",
"#types/request": "^2.48.3",
"#types/request-promise": "^4.1.45",
"apollo-server-express": "^2.9.12",
"bcrypt": "^3.0.7",
"bull": "^3.12.1",
"bull-arena": "^2.6.4",
"check-types": "^11.0.0",
"compression": "^1.7.4",
"cookie-parser": "^1.4.4",
"core-util-is": "^1.0.2",
"cors": "^2.8.5",
"easygraphql-format-error": "0.0.3",
"express": "^4.17.1",
"express-graphql": "^0.9.0",
"express-winston": "^4.0.1",
"graphql": "^14.5.8",
"graphql-tools": "^4.0.6",
"graphql-type-json": "^0.3.1",
"http-errors": "^1.7.3",
"is-my-json-valid": "^2.20.0",
"jsonwebtoken": "^8.5.1",
"newrelic": "^6.3.0",
"object-mapper": "^6.0.1",
"pg": "^7.13.0",
"pug": "^2.0.4",
"redis": "^2.8.0",
"reflect-metadata": "^0.1.13",
"request": "^2.88.0",
"request-promise": "^4.2.5",
"segfault-handler": "^1.3.0",
"tsc-watch": "^4.0.0",
"tsconfig-paths": "^3.9.0",
"type-graphql": "^0.17.5",
"typeorm": "^0.2.20",
"typeorm-encrypted-column": "0.0.4",
"typeorm-naming-strategies": "^1.1.0",
"typescript": "^3.7.2",
"webpack-dev-server": "^3.9.0",
"winston": "^3.2.1",
"winston-daily-rotate-file": "^4.2.1",
"winston-loggly-bulk": "^3.0.1"
}
And my docker file is the following
FROM node:10
RUN apt update
RUN npm install typescript -g
COPY package*.json ./
RUN npm install
RUN npm rebuild bcrypt --build-from-source
ADD . /app
WORKDIR /app
CMD npm run server
I have tried increasing the ulimit, changed the node version in docker file and reduced the --max-old-space-size but to no effect. I also found out that npm rebuild bcrypt --build-from-source fixes an issue with bcrypt that causes this problem and have added that in my docker file link.
For any scripts that are set up in my package.json file for modules installed locally, npm says it cannot find the command.
Below is my package.json. I have already run an ‘npm install` without any issues installing the packages.
{
"name": "app",
"private": true,
"dependencies": {
"#babel/core": "^7.8.6",
"#babel/preset-env": "^7.8.6",
"#babel/preset-react": "^7.8.3",
"babel-loader": "^8.0.6",
"bootstrap": "^4.4.1",
"jquery": "^1.9.1",
"react": "^16.13.0",
"react-dom": "^16.13.0",
"react-owl-carousel": "^2.3.1",
"react-redux": "^7.2.0",
"react-router-dom": "^5.1.2",
"react-slick": "^0.25.2",
"reactstrap": "^8.4.1",
"redux": "^4.0.5",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0",
"slick-carousel": "^1.8.1",
"webpack-cli": "^3.3.11"
},
"scripts": {
"postinstall": "webpack",
"start": "webpack --watch --mode=development"
},
"engines": {
"node": "10.13.0",
"npm": "6.4.1"
},
"devDependencies": {
"css-loader": "^3.4.2",
"style-loader": "^1.1.3",
"webpack": "^4.42.0"
}
}
When I try to run npm start from the root file, I get these errors:
sh: webpack: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! app# start: `webpack --watch --mode=development`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the app# start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
I have this same problem across multiple projects. If I install globally it will work, but from what I understand with webpack, that should not be necessary and is discouraged: https://webpack.js.org/guides/installation/#global-installation.
Any ideas what the trouble may be here? Thanks!
The issue was the directory my app was located in had a / in the directory name (e.g. a/b > app > node_modules). The / is interpreted as a : and npm doesn't like that.