I have a "eslint-config" module published as a github repo. It has such dependencies:
"dependencies": {
"babel-eslint": "7.2.3",
"babel-runtime": "^6.0.0",
"eslint": "3.19.0",
"eslint-config-airbnb": "15.0.1",
"eslint-plugin-import": "2.3.0",
"eslint-plugin-jsx-a11y": "5.0.3",
"eslint-plugin-react": "7.0.1"
},
In another empty project "estest" I installed this module as a single dev dependency:
npm i -D github:MyTeam/eslint-config
The command produced the output:
npm WARN eslint-config-airbnb#15.0.1 requires a peer of eslint#^3.19.0 but none was installed.
npm WARN eslint-plugin-import#2.3.0 requires a peer of eslint#2.x - 3.x but none was installed.
npm WARN eslint-plugin-jsx-a11y#5.0.3 requires a peer of eslint#^2.10.2 || 3.x but none was installed.
npm WARN eslint-plugin-react#7.0.1 requires a peer of eslint#^3.0.0 but none was installed.
npm WARN eslint-config-airbnb-base#11.2.0 requires a peer of eslint#^3.19.0 but none was installed.
+ eslint-config#1.0.0
added 203 packages in 13.898s
It acts like eslint module was not installed.
If I look inside estest/node_modules I see that structure:
node_modules
eslint-config // <-- this is my module
node_modules
eslint // <-- it has only one dep installed inside
// all other `eslint-config` deps are flat-installed into root:
babel-eslint
eslint-config-airbnb
eslint-plugin-import
eslint-plugin-jsx-a11y
eslint-plugin-react
...
So all eslint-config dependencies were flat-installed into root node_modules except eslint. And because of this some of them complains that peer dependency is missing.
And npm ls command shows eslint as unmet peer dep:
└─┬ eslint-config#1.0.0
├─┬ babel-eslint#7.2.3
├─┬ UNMET PEER DEPENDENCY eslint#3.19.0
├─┬ eslint-config-airbnb#15.0.1
│ ├── UNMET PEER DEPENDENCY eslint#^3.19.0
│ └── eslint-config-airbnb-base#11.2.0
├─┬ eslint-plugin-import#2.3.0
│ ├─┬ eslint-import-resolver-node#0.2.3
│ ├─┬ eslint-module-utils#2.1.1
├─┬ eslint-plugin-jsx-a11y#5.0.3
└─┬ eslint-plugin-react#7.0.1
I want to be able to just install eslint-config dependency and do not install eslint separately. How to do it?
Related
I've been trying for 2 hours straight now, to downgrade Parse Server from 3.0.0 to 2.8.4 and I fail every time!
I changed it from package.json, npm install, go to dashboard, still: server version 3.0.0!
Here are the logs of the installation:
npm install
npm WARN deprecated uws#10.148.1: stop using this version
parse-server-example#1.4.0 /root/parse-server-example
├─┬ parse-dashboard#1.2.0
│ └─┬ express#4.16.3
│ ├── array-flatten#1.1.1
│ ├── encodeurl#1.0.2
│ ├─┬ finalhandler#1.1.1
│ │ └── encodeurl#1.0.2
│ ├─┬ send#0.16.2
│ │ └── encodeurl#1.0.2
│ └─┬ serve-static#1.13.2
│ └── encodeurl#1.0.2
└─┬ parse-server#2.8.4
├─┬ #parse/push-adapter#3.0.0-alpha2
│ └─┬ parse#1.11.1
│ └─┬ ws#3.3.3
│ └── ultron#1.1.1
├── #parse/simple-mailgun-adapter#1.0.2
├── commander#2.16.0
├─┬ express#4.16.2
│ ├── array-flatten#1.1.1
│ └── encodeurl#1.0.2
├── lru-cache#4.1.2
├─┬ mongodb#3.1.1
│ └─┬ mongodb-core#3.1.0
│ └── bson#1.0.9
├─┬ parse#1.11.1
│ └─┬ ws#3.3.3
│ └── ultron#1.1.1
└── request#2.85.0
npm ERR! Linux 4.15.0-34-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v8.10.0
npm ERR! npm v3.5.2
npm ERR! path /root/parse-server-example/node_modules/.staging/node-pre-gyp-49f396d5
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/root/parse-server-example/node_modules/.staging/node-pre-gyp-49f396d5' -> '/root/parse-server-example/node_modules/bcrypt/node_modules/node-pre-gyp'
npm ERR! enoent ENOENT: no such file or directory, rename '/root/parse-server-example/node_modules/.staging/node-pre-gyp-49f396d5' -> '/root/parse-server-example/node_modules/bcrypt/node_modules/node-pre-gyp'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! /root/parse-server-example/npm-debug.log
What can I do?
Absolutely never run this command without looking at what's going to be deleting and understanding whether or not it's OK, but try doing rm -rf <path>/node_modules/*. Maybe wait for a comment or two confirming. Seriously don't just randomly do an rm -rf command because someone on the internet told you to.
But in this case, you should be fine deleting node_modules, and a package-lock.json if it exists, and running npm install to do a bit of a fresh install of what's in your package.json.
Seriously, absolutely don't do this until you look up what it is you're doing and verify it'd be OK.
package-lock.json tracks the changes in the versions of modules you use. node_modules is where npm install installs all the modules to. When you run the command, it checks your node_modules vs your package.json to see if there are any more recent versions that match your criteria. Idk why it's not downgrading, but if your package.json is set up right, this should give it a fresh install and should work.
Do at your own risk, though.
I tried to npm uninstall -g is not working.
First I had tried npm ls -g --depth=0 it produced the following results
/usr/local/lib
├── UNMET PEER DEPENDENCY #babel/core#7.0.0-beta.4
├── #babel/node#7.0.0-beta.44
├── aws-cli#0.0.2
├── babel-core#6.26.0
├── babel-loader#7.1.4
├── babel-plugin-transform-decorators-legacy#1.3.4
├── babel-plugin-transform-object-rest-spread#6.26.0
├── babel-plugin-transform-optional-chaining#7.0.0-beta.3
├── babel-preset-react#6.24.1
├── babel-preset-stage-3#6.24.1
├── babel-register#7.0.0-beta.3
├── coffeescript#2.2.4
├── graceful-fs#4.1.11
├── minimatch#3.0.4
├── n#2.1.8
├── npm#5.8.0
├── ntdl#1.0.2
├── pdf-compress#1.0.0 -> /home/ubuntu/workarea/sourcecode/pdf-optimise
├── virtualenv#0.3.1
├── UNMET PEER DEPENDENCY webpack#2 || 3 || 4
└── yarn#1.5.1
npm ERR! peer dep missing: #babel/core#7.0.0-beta.44, required by
#babel/node#7.0.0-beta.44
npm ERR! peer dep missing: webpack#2 || 3 || 4, required by babel-
loader#7.1.4
npm ERR! peer dep missing: #babel/core#7.0.0-beta.44, required by
#babel/register#7.0.0-beta.44
npm ERR! peer dep missing: webpack#>=0.9 <2 || ^2.1.0-beta || ^2.2.0,
required by worker-loader#0.8.1
}
Then I had tried uninstalling it didn't succeeded
root#ip-10-252-14-11:/home/ubuntu/workarea/sourcecode/ntdl# sudo npm
uninstall -g #babel/node#7.0.0-beta.44
up to date in 0.063s
root#ip-10-252-14-11:/home/ubuntu/workarea/sourcecode/ntdl# babel-node --
version
7.0.0-beta.44
Then I tried
root#ip-10-252-14-11:/home/ubuntu/workarea/sourcecode/ntdl# npm uninstall
-g *
npm ERR! code ENOLOCAL
npm ERR! Could not install from
"../../home/ubuntu/workarea/sourcecode/ntdl" as it does not contain a
package.json file.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-04-10T01_33_46_993Z-debug.log
Please help me in resolving this issue.
With Many Thanks,
Bharath AK
Did you try this? npm uninstall npm -g
see here
I'm trying to install vue-pagination-2 (https://github.com/matfish2/vue-pagination-2) in my application.
I run the following command:
npm install --save vue-pagination-2
but I keep getting this error:
my_project/myProject
├── UNMET PEER DEPENDENCY eslint#3.19.0
└── UNMET PEER DEPENDENCY vue#2.2.6
So I run:
npm install --save vue#2.2.6
But I get exactly the same error.
How can vue#2.2.6 be an unmet dependency since I'm installing exactly that package?
I have already tried to delete node_modules folder and running npm install again.
How can I solve this?
Moreover my package.json file already have those version installed:
"eslint": "^3.19.0",
"vue": "^2.2.6",
I am trying to install karma-jasmine on Windows 7 / Git Bash, according to these guidelines: http://karma-runner.github.io/0.13/intro/installation.html
However, the installation fails for jasmine-core:
$ npm install karma-jasmine karma-chrome-launcher --save-dev
npm WARN install Couldn't install optional dependency: Unsupported
ngut#1.0.0 g:\SW Engineering\ngUT
├── UNMET PEER DEPENDENCY jasmine-core#*
├─┬ karma-chrome-launcher#0.2.2
│ ├─┬ fs-access#1.0.0
│ │ └── null-check#1.0.0
│ └─┬ which#1.2.0
│ └─┬ is-absolute#0.1.7
│ └── is-relative#0.1.3
└── karma-jasmine#0.3.6
npm WARN EPEERINVALID karma-jasmine#0.3.6 requires a peer of jasmine-core#* but
none was installed.
I tried the installation first with Cygwin, only to learn that npm is not supported on Cygwin, but there the failing dependency was fsevent.
The global installation of jasmine-core succeeds, but I am trying to follow this tutorial and karma start karma.conf.js fails for the same reason (missing jasmine-core) with the global installation as well.
Finally, the exact same problem appears on OSX as well.
Karma v.0.13.16 just did not support v.5.3.0 of Node. The supported Node versions were listed on Karma installation page.
I just follow the instructions in there:
http://karma-runner.github.io/0.12/intro/installation.html
Karma has been installed correctly.
Though, I can't install karma-jasmine and karma-chrome-launcher. I am actually having a lot's of warnings about README:
npm WARN package.json abbrev#1.0.4 No README data
npm WARN package.json ansi#0.2.1 No README data
npm WARN package.json archy#0.0.2 No README data
npm WARN package.json asn1#0.1.11 No README data
...
and then a few unmet dependancies:
*
npm WARN unmet dependency /usr/lib/node_modules/block-stream requires inherits#'~2.0.0' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency /usr/lib/node_modules/fstream requires inherits#'~2.0.0' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency /usr/lib/node_modules/fstream-ignore requires inherits#'2' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency /usr/lib/node_modules/fstream-npm requires inherits#'2' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency /usr/lib/node_modules/glob requires inherits#'2' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency /usr/lib/node_modules/npmconf requires inherits#'~2.0.0' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency /usr/lib/node_modules/tar requires inherits#'2' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
*
Any idea where could that come from ?
Follow below steps to setup karma-jasmine environment
• Install nodejs
o Download nodejs suitable setup file from https://nodejs.org/download/ website.
o Install nodejs using setup file
• Installation of Karma and plugins using npm(node package manager)
o Open command prompt
o Traverse to project structure
cd ‘\path of project folder’
(path till folder which is having /src folder in it)
o Install Karma
npm install karma --save-dev
• New folder in project structure will get created named as ‘node_modules’
• If any warnings appear on command prompt ignore them
o Install browser plugins(optional)
npm install karma-jasmine karma-chrome-launcher --save-dev
• If any warnings appear on command prompt ignore them
o Install Karma command line interpreter globally
npm install -g karma-cli
• If any warnings appear on command prompt ignore them