Keystonejs install fails due to lodash#3.3.1 dependency issue - node.js

I am attempting to install Keystonejs following these instructions, but I am receiving a dependency error message when installing yo:
npm ERR! code ETARGET
npm ERR! notarget No matching version found for lodash#3.3.1
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
SPECS:
node v8.9.4
OS: macOS HighSierra V10.13.3
It appears that lodash#3.3.1 had an issue with the NPM register at the time, but this makes me wonder why this hasn't be upgraded within yo - which in turn makes me thing I am somehow screwing up the process.
Anyway anyone could point me in the right direction would be highly appreciated.
Mike

I don't have the answer, but I just thought I'd share with you:
My node is v7.10.1 and my npm is 4.2.0 and I can install lodash#3.3.1 without any problem:
me#computer:~/Downloads/lodash-test$ npm install lodash#3.3.1
/home/me/Downloads/lodash-test
└── lodash#3.3.1
Also I can install yo without any issue, and the its lodash dependencies have version 4.17.5:
me#computer:~/Downloads/lodash-test$ npm install yo
...
...
Yeoman Doctor
Running sanity checks on your system
✔ Global configuration file is valid
✔ NODE_PATH matches the npm root
✔ Node.js version
✔ No .bowerrc file in home directory
✔ No .yo-rc.json file in home directory
✔ npm version
Everything looks all right!
/home/me/Downloads/lodash-test
└─┬ yo#2.0.1
├─┬ async#2.6.0
│ └── lodash#4.17.5
...
...
├── lodash#4.17.5
├─┬ meow#3.7.0
│ ├─┬ camelcase-keys#2.1.0
...
...
I developed a web page with KeystoneJS a few months ago around December 2017. When I look at its package.json file, I see that the lodash version is 4.13.1:
...
"keystone": "4.0.0-beta.5",
"lodash": "^4.13.1",
...

Related

What does npm ERR! code ELSPROBLEMS mean?

Building a node project, using serverless
Firstly I get the error
Error:
Error: npm ls -prod -json -depth=1 failed with code 1
at ChildProcess.<anonymous> (/Users/jrobens/NetBeansProjects/azuron/winpay/winpay-
uploader/node_modules/serverless-webpack/lib/utils.js:91:16)
To find our more information I enter npm ls -prod -json -depth=1 and get
npm ERR! code ELSPROBLEMS
npm ERR! invalid: serverless#3.2.1
/my-project/node_modules/serverless
{
It looks as though webpack worked
webpack compiled successfully in 4581 ms
About the environment: node-14, typescript, aws
├── #serverless/typescript#3.2.0
├── #types/serverless#3.0.0
├── serverless-apigw-binary#0.4.4
├── serverless-certificate-creator#1.6.0
├── serverless-dynamodb-local#0.2.40
├── serverless-http#2.7.0
├── serverless-iam-roles-per-function#3.2.0
├── serverless-plugin-aws-alerts#1.7.4
├── serverless-prune-plugin#2.0.1
├── serverless-s3-local#0.6.21
├── serverless-webpack#5.6.1
Fixing this
npm ls -prod json
produces a json list of the packages. The -depth=1 flag brought an error to light. There was an invalid package.
Find the invalid package by
npm ls
and fix any error messages.
In my case there was an old serverless plugin that had a dependency of a different version of serverless.
I got the same error then updated angular and that solved it.
$ ng update
I fixed removing packages-lock.json and then doing npm install.
Not sure if this is the best way to fix it, but it worked for me.

Why does NPM ask for peer dep's when it's clearly installed?

Im working with AWS-Amplify and just updated it's CLI to the latest version, and now NPM complains that there are unmet dependencies, though graphql is clearly installed at the right version. What am missing here? Thanks for any clarification!
$ npm list -g --depth 0
/usr/local/lib
├── #aws-amplify/cli#4.12.0
├── #vue/cli#4.0.5
├── browser-sync#2.26.7
├── firebase-tools#7.10.0
├── graphql#14.5.8
├── nodemon#2.0.2
├── npm#6.13.6
└── parcel-bundler#1.12.4
npm ERR! peer dep missing: graphql#^14.5.8, required by #graphql-toolkit/file-loading#0.9.0
npm ERR! peer dep missing: graphql#^14.2.0, required by relay-compiler#6.0.0
This happens when your node version is not latest or when the dependencies require a certain version of other npm. Just check if all the npm packages and node is of latest version.

NPM - dependencies require package in multiple versions, but only one version is installed

After npm install on clean environment, I get following problem with b package:
npm ls b
a#2.0.6
├── b#3.0.0
├─┬ c#3.0.1
│ └── UNMET DEPENDENCY b#^1.0.0
└─┬ d#4.1.1
└─┬ c#2.1.0
└── UNMET DEPENDENCY b#^1.0.0
npm ERR! missing: b#^1.0.0, required by c#3.0.1
npm ERR! missing: b#^1.0.0, required by c#2.1.0
This obviously causes errors, as package c needs b#^1.0.0, but receives b#3.0.0.
I struggled to force npm to install both versions as if they were different packages. Tried going through npm docs, package-locks, and shinkwrap, but with no success. How can I solve this problem?
Environment info:
OS: macOS High Sierra 10.13.4
npm: 6.10
node: v8.8.1
Playing around I noticed, that a lot of packages had UNMET DEPENDENCY. Following procedure fixed the problem:
rm -rf node_modules
npm cache clean --force
npm install
After cleaning npm cache the issue is completely resolved:
a#2.0.6
├── b#3.0.0
├─┬ c#3.0.1
│ └── b#^1.0.0
└─┬ d#4.1.1
└─┬ c#2.1.0
└── b#^1.0.0
Strange bug.

What does 'invalid' mean when using npm list?

I am new to nodejs and i had just installed bower module globally. Ever since then, npm list command gives the following output which I searched for on the web but couldn't find any help :
**npm ERR! invalid: chalk#0.5.1 /usr/local/lib/node_modules/bower/node_modules/chalk
npm ERR! invalid: ansi-regex#0.2.1 /usr/local/lib/node_modules/bower/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex
npm ERR! invalid: configstore#0.3.1 /usr/local/lib/node_modules/bower/node_modules/update-notifier/node_modules/configstore
npm ERR! invalid: object-assign#0.3.1 /usr/local/lib/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/object-assign
npm ERR! invalid: registry-url#0.1.1 /usr/local/lib/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url
npm ERR! invalid: strip-ansi#0.2.2 /usr/local/lib/node_modules/bower/node_modules/update-notifier/node_modules/string-length/node_modules/strip-ansi
npm ERR! not ok code 0**
The rest of the output is normal and lists the installed modules. Can anyone explain what's going on?
I was getting this error having the same package installed both in "dependencies" and "devDependencies" with different versions.
It means that something depends on, for example, "async":"0.9.3" but when they do require("async"), npm thinks that they'll get some other version. And also check that the dependencies and their versions listed in your package.json file are available.
If everything is right then you can solve this problem with
npm update
followed by
npm install.
I was getting this error after installing a newer version of a module, without updating my package.json. So the package.json required the older version, while npm list was detecting a newer version in my node_modules directory.
Running the following command got me rid of the message.
npm install {required_module}#{new_version} --save
Simplest answer
This can arise when the installed version of a package does not correspond to what package.json would install.
Example
Say you have specified "axios": "0.19.2", in your package.json, but after that you would install a specific version using npm install axios#0.18.1.
An npm list | grep axios would now yield
├─┬ axios#0.18.1 invalid
Follow the instructions in this answer on how to fix it.
I was getting a related but different error (but ended up here, so I'm answering here) where after running npm update I'd get. (No such issue with npm install, fwiw)
myapp#1.0.0 /home/malcolm/myapp
├── beeminder#1.4.3 invalid
The beeminder package is one I maintain, so in my main app I had set its semver to latest. This seemed to work fine before, but I guess a newer version of npm doesn't like it.
I figured it was reasonable to just use ^1.4.3 because if I'm introducing new changes then I probably am changing my own code anyway. But if for some weird reason you need the latest latest of a package (including breaking changes!) then you can use >= as a prefix instead of ^.

Error when installing Grunt

Hello I recently tried installing grunt-command line interface according to the instructions on their website using the node package manager command
sudo npm install -g grunt-cli
It didnt work and I got the following errors
/usr/local/bin/grunt -> /usr/local/lib/node_modules/grunt-cli/bin/grunt
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/couch-login requires request#'~2.9.202' but will load
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/request,
npm WARN unmet dependency which is version 2.30.0
grunt-cli#0.1.13 /usr/local/lib/node_modules/grunt-cli
├── resolve#0.3.1
├── nopt#1.0.10 (abbrev#1.0.5)
└── findup-sync#0.1.3 (lodash#2.4.1, glob#3.2.11)
➜ ~
I'm not sure how i update this dependancy. Can anyone shed any light on this?
Try the following:
npm cache clean
npm install -g npm (update npm)
reinstall node.js completely (if all fails).
Please let me know if this works.

Resources