Redux-form not getting installed & npm install not administrator errors - node.js

I am trying to install redux-form & redux-form-material-ui using npm install, but its showing you need to install peer dependencies first, which I am doing but these modules are still not available under node modules folder.
I am running 'npm install' in git bash as an administrator but its showing run as a root/administrator. However its running when I am using 'npm install -g', I am not getting the reason for this odd behavior.
However still after using -g those modules are not getting installed - Error of module not found is coming.
Environment?
Node version - 8.0.0 ( Even tried with v6) npm - 5.4.0 Redux form
-latest OS- Windows 10
Logs-
$ npm install redux-form npm ERR! path
D:\ABC\template\node_modules\fsevents\node_modules\aproba\package.json
npm ERR! code EPERM npm ERR! errno -4048 npm ERR! syscall unlink npm
ERR! Error: EPERM: operation not permitted, unlink
'D:\ABC\template\node_modules\fsevents\node_modules\aproba\package.json'
npm ERR! { Error: EPERM: operation not permitted, unlink
'D:\ABC\template\node_modules\fsevents\node_modules\aproba\package.json'
npm ERR! stack: 'Error: EPERM: operation not permitted, unlink
'D:\ABC\template\node_modules\fsevents\node_modules\aproba\package.json'',
npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall:
'unlink', npm ERR! path:
'D:\ABC\template\node_modules\fsevents\node_modules\aproba\package.json'
} npm ERR! npm ERR! Please try running this command again as
root/Administrator. npm ERR! A complete log of this run can be found
in: npm ERR!
C:\Users\dbhowmick.ABC\AppData\Roaming\npm-cache_logs\2017-09-18T13_03_31_862Z-debug.log
For just 'npm install' same error is coming, even if I am running as administrator.
$ npm install -g redux-form npm WARN redux-form#7.0.4 requires a peer
of react#^15.0.0-0 || ^16.0.0-0 but none is installed. You must
install peer dependencies yourself. npm WARN redux-form#7.0.4 requires
a peer of react-redux#^4.3.0 || ^5.0.0 but none is installed. You must
install peer dependencies yourself. npm WARN redux-form#7.0.4 requires
a peer of redux#^3.0.0 but none is installed. You must install peer
dependencies yourself.
redux-form#7.0.4 added 24 packages in 14.599s Its showing added but no
folder created under node modules, & redux form module not found is
coming.
For installing redux-form-material-ui same error is coming
$ npm install -g redux-form-material-ui
npm WARN redux-form-material-ui#4.2.0 requires a peer of react#15 but none is installed. You must install peer dependencies yourself.
npm WARN redux-form-material-ui#4.2.0 requires a peer of redux-form#6 but none is installed. You must install peer dependencies yourself.
redux-form-material-ui#4.2.0
added 1 package in 1.509s

Updating the npm through command prompt(run as administrator) and then installing redux worked for me.
Update:
npm i -g npm
Install:
npm install redux --save

I also faced the same issue then I run cmd as administrator
and run yarn add react-redux and it worked for me smoothly.
I think yarn is best to use instead of npm

Related

Issue when I try to execute npm install

when I run the command npm install, it displays this error:
[log#server:www]$ npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined#undefined
npm ERR! Found: vue#2.6.14
npm ERR! node_modules/vue
npm ERR! dev vue#"^2.5.17" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vue#"^3.0.0" from vee-validate#4.4.4
npm ERR! node_modules/vee-validate
npm ERR! vee-validate#"^4.2.3" 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 /root/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-06-09T01_39_40_386Z-debug.log
I wonder, how can I fix it? What does it mean?
Thanks
It looks like you're trying to install vee-validate version 4.0 in a Vue 2.x application. You can see the compatible version in the vee-validate repo.
How to fix:
Option 1:
Install an older version of Vee-validate (v2 or v3).
First, you'll need to uninstall the version you currently have installed (I'm assuming you installed vee-validate#next since that's the doc recommendation)
npm uninstall vee-validate#next
You can then find the list of versions available with
npm info vee-validate versions
Finally, install an older version with
npm install vee-validate#3.4.9
Replace the 3.4.9 with whatever version you would like to install - as of the time of writing, 3.4.9 is the latest stable tag
Option 2:
Upgrade from Vue 2 to Vue 3 following the upgrade guide.
Note that this is still a work in progress and may have some stability issues and depending on the state of the project I would consider using the above option for the time being.
Step:-1 Make sure node.js is installed on your system. You can check with the command npm --version or node --version
Step:-2 Clear npm cache. run this command npm cache clear -f
Step:-3 Then try to run npm install

Latest version of npm required to install

I'm a newbie in coding so please take it easy on me.
I have project on github, made by softwarehouse - its MVP of an app made with Django Rest framework, React app, Docker.
Now I want to run it on my mac, and there is an issue.
When i run docker-compose.yml i start with docker-compose up, it is instaling all packages untill it goes to the step where it tries to instal npm, and i get an error:
npm notice
npm notice New patch version of npm available! 7.4.0 -> 7.4.3
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v7.4.3>
npm notice Run `npm install -g npm#7.4.3` to update!
npm notice
ERROR: Service 'pet-frontend' failed to build : The command '/bin/sh -c npm install --silent' returned a non-zero code: 1
Failed to deploy 'Compose: docker-compose.yml': `docker-compose` process finished with exit code 1
I don't know why i cannot instal latest version? I have newest node.js where npm is 7.4.0.
How i can force install of 7.4.0 or how to install 7.4.0? so deployment could go further?
__ more info __
frontend dockerfile looks like this:
FROM node:latest
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
COPY package.json ./
RUN npm install --silent
RUN npm install react-scripts#3.4.1 -g --silent
COPY . ./
CMD ["npm", "start"]
when i add there 'RUN npm install -g npm#7.4.3' - still get the same error
When i run npm without --silent i get this error:
npm notice
npm notice New patch version of npm available! 7.4.0 -> 7.4.3
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v7.4.3>
npm notice Run `npm install -g npm#7.4.3` to update!
npm notice
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: prop-types#15.6.0
npm ERR! node_modules/prop-types
npm ERR! peer prop-types#"<=15.6.0" from check-prop-types#1.1.2
npm ERR! node_modules/check-prop-types
npm ERR! dev check-prop-types#"^1.1.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! react-leaflet-search#"^2.0.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: prop-types#15.7.2
npm ERR! node_modules/prop-types
npm ERR! peer prop-types#"^15.7.2" from react-leaflet-search#2.0.1
npm ERR! node_modules/react-leaflet-search
npm ERR! react-leaflet-search#"^2.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 /root/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-01-26T10_49_01_333Z-debug.log
ERROR: Service 'petsy-frontend' failed to build : The command '/bin/sh -c npm install' returned a non-zero code: 1
Failed to deploy 'Compose: docker-compose.yml': `docker-compose` process finished with exit code 1
I added the following line before npm install and it worked for me. It picks the latest npm version and install in your directory
RUN npm install -g npm#7.19.1
npm install npm#{latest version}
You can use this, it worked for me just now

I am creating an Node.js app and I need to install ejs but I am unable to install it. It is showing me the following error

node --harmony ./postinstall.js
'node' is not recognized as an internal or external command,
operable program or batch file.
npm WARN #react-navigation/core#3.7.5 requires a peer of react#* but
none is installed. You must install peer dependencies yourself.
npm WARN react-native-safe-area-view#0.14.9 requires a peer of react#*
but none is installed. You must install peer dependencies yourself.
npm WARN react-native-safe-area-view#0.14.9 requires a peer of
react-native#* but none is installed. You must install peer
dependencies yourself.
npm WARN react-navigation#4.3.7 requires a peer of react#* but none is
installed. You must install peer dependencies yourself.
npm WARN react-navigation#4.3.7 requires a peer of react-native#* but
none is installed. You must install peer dependencies yourself.
npm WARN ashutosh#1.0.0 No description
npm WARN ashutosh#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ejs#3.1.3 postinstall: node --harmony ./postinstall.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ejs#3.1.3 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely
additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!
C:\Users\Ashutosh\AppData\Roaming\npm-cache_logs\2020-05-22T23_26_50_117Z-debug.log
You need to have a path to NodeJS inside your environment variables list.
On some OS reboot might be needed to make this work.
Try reboot or reinstall NodeJS and then reboot.

Install ReactJS on Ubuntu 18.04 -- npm permission denied

I am new to Linux and I am trying to get set-up with nodejs, but I have not been able to figure out why I can't install react. I am following directions that I have seen on the web, but I am wondering why I seem to not have the privileges necessary to install react. It's a personal environment, so I wasn't expecting any issue. Below is what I have run and the final error that the last line gave me.
sudo apt update && sudo apt upgrade
sudo apt install nodejs
sudo npm install npm
node -v
v8.10.0
npm -v
3.5.2
sudo npm install npm#latest -g
npm -v
6.10.0
npm install -g create-react-app
Everything above runs just fine until the last command. Then I get the following error, regardless of working directory.
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! { Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! stack: 'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).
npm ERR! A complete log of this run can be found in:
npm ERR! /home/me/.npm/_logs/2019-07-06T19_33_32_971Z-debug.log
Using npx (with npm 5.2+)
If you're using npm 5.2+, you may create a ReactJS app like below:
npx create-react-app my-app
Now your app is in a folder my-app, you can cd into the folder and run npm start.
Using older versions of npm with npm install
You may also install it with a global install with npm, infact for older npm versions (< 5.2) the official documentation for create-react-app links to instructions by Dan Abramov (#co-author of create-react-app):
npm install -g create-react-app
However you may need sudo for a global -g install or work around it
Everything above runs just fine until the last command. Then I get the following error, regardless of working directory.
That's because your last command is a global install (-g).
Unless there is a reason against, you may install it with sudo:
sudo npm install -g create-react-app
To install without sudo, please refer to this question: npm throws error without sudo
I was also having this issue, here is how it was resolved
Make sure you have npm installed or use:
sudo apt install npm
Then
sudo npm -g install create-react-app
To create the app I did not use 'npm' before the command line, instead use this:
create-react-app nameofyourapp
That worked for me.

Unable to install angular cli with npm errno -4048 package.json

I tried installing angular cli with npm. But I'm getting the below error while executing the command npm install -g #angular/cli.
I am not executing this command as admin, but as a user.
D:\AngularWorkstation>npm install -g #angular/cli
npm WARN sass-loader#6.0.6 requires a peer of node-sass#^4.0.0 but none is installed. You must install peer dependencies yourself.
npm ERR! path **D:\node_modules\node_modules\#angular\cli\node_modules\which\package.json.365294863
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename
npm ERR! Error: EPERM: operation not permitted, rename 'D:\node_modules\node_modules\#angular\cli\node_modules\which\package.json.365294863' -> 'D:\node_modules\node_modules\#angular\cli\node_modules\which\package.json'
npm ERR! { Error: EPERM: operation not permitted, rename 'D:\node_modules\node_modules\#angular\cli\node_modules\which\package.json.365294863' -> 'D:\node_modules\node_modules\#angular\cli\node_modules\which\package.json'
npm ERR! cause:
npm ERR! { Error: EPERM: operation not permitted, rename 'D:\node_modules\node_modules\#angular\cli\node_modules\which\package.json.365294863' ->** 'D:\node_modules\node_modules\#angular\cli\node_modules\which\package.json'
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'D:\\node_modules\\node_modules\\#angular\\cli\\node_modules\\which\\package.json.365294863',
npm ERR! dest: 'D:\\node_modules\\node_modules\\#angular\\cli\\node_modules\\which\\package.json' },
npm ERR! stack: 'Error: EPERM: operation not permitted, rename \'D:\\node_modules\\node_modules\\#angular\\cli\\node_modules\\which\\package.json.365294863\' -> \'D:\\node_modules\\node_modules\\#angular\\cli\\node_modules\\which\\package.json\'',
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'D:\\node_modules\\node_modules\\#angular\\cli\\node_modules\\which\\package.json.365294863',
npm ERR! dest: 'D:\\node_modules\\node_modules\\#angular\\cli\\node_modules\\which\\package.json',
npm ERR! parent: '#angular/cli' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\techno\AppData\Roaming\npm-cache\_logs\2018-01-03T09_14_35_602Z-debug.log
*PS : I'm using Windows10 OS. I also tried changing the npm global path to'D:\node_modules' to check if it's due to permission issue. However the output is the same.
node --version : v7.7.2
npm --version : 4.1.2*
I had a similar issue when trying to install Yeoman with npm on Windows 10. The culprit turned out to be the McAfee AV software that was installed on my machine.
McAfee seemed to be scanning the changes that npm was trying to make to a json file and as part of the scanning routine, prevented the rename from occurring. This resulted in a 4048 error being raised by npm similar to the error in your output.
To get around this I:
Uninstalled McAfee and restarted my machine so that it reverted to Microsoft's built-in security software.
Re-ran the npm install command and it worked correctly.
Alternatively, you could change the settings of your AV software to not actively check file changes for the node_modules folder. This would hopefully allow your AV software to stay installed and the npm command to work too.
From your error logs, It seems that there is some permission issue while installing the packages. You can specifically resolve this issue by two ways.
1) If you are trying to install the packages globally then you have to run the npm install <pkg_name> -g command with the administrative user or using sudo npm install <pkg_name> -g command.
To install the npm-packages globally you can follow the steps below:
Run the command prompt as the administrative user.
Run npm install <pkg_name> -g.
2) You should try going to the top-level folder in Windows Explorer, right-click on "get more info" option then go down to the permissions section, give yourself all permissions, and tell it to apply them recursively.
Or simply you can go to specified npm working directory and edit to permission section and allow all the permission to the current user and also change the owner to itself for all the recursive directories as well.
Then boot up Windows again.
Note: If you are installing an npm-package locally, then you should be in your local project directory and can try running sudo npm install <pkg-name> command to install required package. the purpose of using sudo is that it will change your owner permissions so you can make your current user authorized to run npm commands.
I'd recommend you to take a look at https://docs.npmjs.com/getting-started/fixing-npm-permissions
1) uninstall node
2) download latest version of node from [https://nodejs.org/en/][1] .
3) install node js

Resources