npm install error with connect module - node.js

I have installed all dependencies related with this project https://github.com/msfrisbie/mean-stripdown.git.
with command "npm install".
and then I got the next errors related only with connect#2.9.0 module:
npm ERR! missing bytes#0.2.1 required by connect#2.9.0
npm ERR! missing qs#0.6.5 required by connect#2.9.0
npm ERR! missing uid2#0.0.2 required by connect#2.9.0
...
How is this possible?

The module you're trying to install requires Express, which requires Connect#2.9.0, which is unable to find the modules you're listing. Trying use npm cache clean and then reinstalling. If that doesn't work, you can alternately completely remove the node_modules folder.

Related

Unable to resolve dependencies for Angular Universal

I need to use SSR for one of my existing angular project. For that, I have migrated one of my projects from v8 to v13.0.0, which itself took a lot of time.
HOwever, now that the app is running fine on v13.0.0, I tried adding SSR to it using
ng add #nguniversal/express-engine
This commands seems to add 13.0.1 of universal, but it keeps failing with errors similar to below one:
D:\my-app-universal>ng add #nguniversal/express-engine i Using package
manager: npm √ Found compatible package version:
#nguniversal/express-engine#13.0.1. √ Package information loaded.
The package #nguniversal/express-engine#13.0.1 will be installed and
executed. Would you like to proceed? Yes npm ERR! code ERESOLVE npm
ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR!
While resolving: my-app-universal#0.0.0 npm ERR! Found:
#angular/animations#13.0.3 npm ERR! node_modules/#angular/animations
npm ERR! #angular/animations#"~13.0.0" from the root project npm
ERR! npm ERR! Could not resolve dependency: npm ERR! peer
#angular/animations#"13.2.3" from #angular/platform-server#13.2.3 npm
ERR! node_modules/#angular/platform-server npm ERR! peer
#angular/platform-server#"^13.0.1" from
#nguniversal/express-engine#13.0.1 npm ERR!
node_modules/#nguniversal/express-engine npm ERR!
#nguniversal/express-engine#"13.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\saurabhtiwari\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\saurabhtiwari\AppData\Local\npm-cache_logs\2022-02-20T12_03_46_821Z-debug.log
× Package install failed, see above.
I have tried a lot to read through the errors and updating package.json to match the required version of peers but it just doesn't go away.
Is there a systematic way to resolve these errors.
Is there a particular version of universal that might go well with Angular 13.
Any suggestions are welcomed.
I followed #misha130's comments advice and fixed the version numbers. I didn't need to need to install with --legacy-peer-deps or --force.
The solution was to upgrade #angular/cli & #angular/core.
With a fresh install, my initial version was 13.0.4. You will need to upgrade them one at a time as the update command fails if there are staged and uncommitted changes in the repository.
ng update #angular/cli
git add . && git commit -m 'nguniversal fix 1 - update #angular/cli'
ng update #angular/core
git add . && git commit -m 'nguniversal fix 2 - update #angular/core'
ng add #nguniversal/express-engine
Thanks everyone for their inputs in the comment. I figured it out as below.
As suggested in comments, first I installed the universal package using --legacy --per --deps
npm install #nguniversal/express-engine --save --legacy-peer-deps
This installed the packages in the node_modules, although the required express-server related files were not added.
To add those files, I then ran:
ng add #nguniversal/express-engine
This creates the required file. It will also try to install the package again and will fail in doing so. Since the package have been installed already, I guess you can ignore its error.

npm install fails (unable to resolve dependency tree)

Trying to reduce any changing variables and using a fresh pull of my code. They are no node-module packages or package-lock.json. I run npm install I get this error:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined#undefined
npm ERR! Found: react-native-screens#2.15.2
npm ERR! node_modules/react-native-screens
npm ERR! react-native-screens#"~2.15.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react-native-screens#"^1.0.0 || ^1.0.0-alpha" from react-navigation-drawer#1.4.0
npm ERR! node_modules/react-navigation-drawer
npm ERR! react-navigation-drawer#"^1.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 /Users/myname/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/myname/.npm/_logs/2021-05-22T01_16_02_351Z-debug.log
If I do an install via --force or npm install --legacy-peer-deps I get a bunch of files mark as outdated and when I run npm update I get the same error. I have tried clearning the cache of my npm as well with no luck npm cache clean. I don't know why this is happening as there is no node-module folder or anything installed for it to give error under my node_modules/react-native-screens...they are no node_modules folder yet. What is causing this and how can I fix it?
Edit:
I ran npm update -g , then npm audit fix and then I got an error:
code ERESOLVE
ERESOLVE unable to resolve dependency tree
While resolving: Sculp latest app#undefined
Found: react-native-screens#2.15.2
node_modules/react-native-screens
react-native-screens#“~2.15.0” from the root project
so I ran expo install react-native-screens and saw that it couldn't find expo...checked my folder and my node_module folder is missing. Like if it never was there or gotten installed.
edit:
I have tried all the methods listed below and it gives random errors that I can not fix it undefined is not an object (evaluating ‘_core.ThemeColors.light’) and I have googled this and one of the main solutions is delete npm and package-lock.json and reinstall but that brings me back to where I started.
It works for me:
npm install --save --legacy-peer-deps
Try this:
npm config set legacy-peer-deps true
Note: this will set this flag permanently
For one time:
npm install --save --legacy-peer-deps
Try to copy your src folder and package.json file and initialize another react-native (new) and replace the source the src folder and package.json file and reenter npm install.
You can use --force in the command line, but you will problably have to deal with a broken react-native dependency later. Anyway, there are other ways of dealing with this broken dependency.
Try it in the following:
npm add react-native
expo install (your needed module)

NPM install throws module not found error

I tried installing node modules by npm install
on a new repository but the following error is shown
npm ERR! code MODULE_NOT_FOUND
npm ERR! Cannot find module './git-host-info.js'
Perhaps bin or main points to a missing file in package.json?

Unable to install vue-onsenui due to peer dependencies

I'm trying to install vue-onsenui using npm install vue-onsenui --save in my project folder. I get the following message but I don't know how to fix it. I've tried npm install ansistyles but that didn't work either.
npm install vue-onsenui --save
npm WARN vue-onsenui#2.4.3 requires a peer of vue#~2.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN network.pack.app_user#1.0.0 No repository field.
npm ERR! path /Users/BenFransen/code/pack-app/node_modules/npm/node_modules/ansistyles
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/Users/BenFransen/code/pack-app/node_modules/npm/node_modules/ansistyles' -> '/Users/BenFransen/code/pack-app/node_modules/npm/node_modules/.ansistyles.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
The path in the error looks strange - have you added npm as a dependency of your project?
npm is generally installed globally and used via the command line - it's usually not needed as a dependency of your project unless you're programatically using npm in your project (is that the case?)
Try removing the node_modules directory (and possibly package-lock.json) and rerunning npm install in your project directory before adding vue-onsenui again - sometimes resetting things like that can help.
On a separate note, the peer dependencies warning is saying you need to have vue as a dependency in your project in order to use vue-onsenui, so make sure that is there as well.

Sails.js missing modules

Experiencing npm module troubles using sails.js.
The first problem was - the contents of assets/ was not being replicated to .tmp/public as documentation indicates. There have been other errors as well.
Research has shown - there are missing modules, one of which is grunt. Doing a
npm install grunt
does make the .tmp/public start working.
But there have been other errors when trying to use the framework.
Install Details:
Server instance: Ubuntu 14.04.1 LTS
(recently deployed, no other changes to server except for node and sails.js)
node --version
v0.12.4
(built from sources)
npm -v
2.10.1
sails --version
0.11.0
sails installed using:
sudo npm install sails -g
Create a new application:
sails new testproject
cd testproject
npm list
produces a long list of missing npm modules to stderr:
npm ERR! missing: colors#~0.6.2, required by grunt#0.4.2
npm ERR! missing: grunt#~0.4.0, required by grunt-contrib-clean#0.5.0
npm ERR! missing: lodash#~2.4.1, required by grunt-contrib-coffee#0.10.1
npm ERR! missing: grunt#~0.4.0, required by grunt-contrib-coffee#0.10.1
npm ERR! missing: grunt#~0.4.0, required by grunt-contrib-concat#0.3.0
npm ERR! missing: grunt#~0.4.0, required by grunt-contrib-copy#0.5.0
and several others.
This seems inexplicable - how could this (missing npm modules) be overlooked? I am new to node - and could have missed something.
Reviewing the getting started page, I didn't notice anything obvious.
This framework seems well-designed - uses some great npm modules.
Has anybody experienced these and found what is needed to fix?
To resolve the missing: colors#~0.6.2, required by grunt#0.4.2 , just navigate to the node_modules/grunt, do a npm install to install the missing dependencies.

Resources