Issue In Installing Packages On Windows 10 - npm

I have a angular project on bitbucket which I cloned into my desktop having OS Windows 10. The folder already has package.json and package-lock.json.
When I hit command npm install inside the project, it runs for around 2 minutes and then it gives two errors and stops:
1.) Error: EPERM: operation not permitted, unlink 2.) npm err! enoent No such file or directory continuously.
I have tried all possible following things:
1.) Run as administrator.
2.) Reinstalled nodejs and run.
3.) Cleared cache and verified using npm commands.
4.) Deleted npm and npm-cache folders and re run again.
5.) Downgraded npm version and re-run again.
6.) Deleted package-lock.json and re-run again.
7.) Gave folder permission fll control and re-run again.
8.) Stopped antivirus and disabled firewall and re-run again.
All above execution didn't solve the problem.
Can you please help me out?
My nodejs version is :- 10.16.3 and npm version is :- 6.9.0

Related

`npx create-nuxt-app <project name>` not working: MacOSX

I use a MacOS High Sierra. For anyone with experience with Nuxt.js, the command
npx create-nuxt-app <project-name> has not worked for me at all!
I consistently come across errors from npm saying I need to update my dependencies. I first tried updating each dependency using npm outdated (check for outdated packages) and
npm update <pkg name>. This did not work.
I also uninstalled and reinstalled node and npm and tired the above (and below processes). Still did not work.
No matter what I do, the Terminal keeps saying my core-js needed to be updated so I did that (I tried both npm i core-js and npm i core-js ) - they did not work.
To update the npm dependencies, I used the command npm install -g npm-check-updates followed by ncu -u, and then tried both npm update and npm install. Nothing has worked so far.
Lastly, I've tried creating a package.json since npm complained that I had no package.json so I created one using npm init and following the instructions to commit the file(s) created. Still, nothing after running npx create-nuxt-app <project-name>.
What is happening? Has anyone experienced this issue? I really love Nuxt.js and I've tried this for an entire day but I'm giving up on using NuxtJS.
EDIT: I managed to solve part of my problem by creating a Nuxt app from scratch. However, I get the following errors:
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nuxt-app#2.11.0 dev:nuxt
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nuxt-app#2.11.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
There are many solution based on your problem. Sharing a simple one, if you have npm installed then execute below command to install npx:
npm install -g npx
you can find all others solution from here
and My suggestions are:
As i saw your description, package.json not created. definitely something wrong for creation of the project, it may cause the read write problem of files into disk. or you have created the project into subdirectory but trying to run the project from parent directory. initially many peoples doing this practice to create scratch project. by the way create a separate directory and then run npx create-nuxt-app. no need to give project name and pass the phase when prompt to create project in same directory. so then i think problem will solved
I fixed the issue! It worked when I created a new directory altogether (the next day) and reran npx create-nuxt-app <new-app>. Get started, build for production, and tests ran perfectly.

How do I install react and react-redux onto my project?

Good afternoon,
I am trying to install react and react-redux onto my project, but I keep getting errors that I don't understand.
$ npx create-react-app learn-redux
npm ERR! code ENOLOCAL
npm ERR! Could not install from "Phelps\AppData\Roaming\npm-cache\_npx\13464" as it does not contain a package.json file.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Taylor Phelps\AppData\Roaming\npm-cache\_logs\2020-02-08T20_44_17_568Z-debug.log
Install for [ 'create-react-app#latest' ] failed with code 1
Could not install from "Phelps\AppData\Roaming\npm-cache\_npx\13464" as it does not contain a package.json file.
I am reading the error, but the problem is...that folder does not exist on my computer and I've checked in the terminal for npm and npx and both are installed on my computer. Does anyone have any ideas on why this may be happening and how to fix it?
Thank you.
According to this Github issue npx has trouble running on Windows if the user has a space in their name and from the error message I'd guess that is the case here. One of the suggested fixes is to set your npm-cache path to a folder without a space in it:
npm config set cache C:\tmp\nodejs\npm-cache --global
Then try running your command again.
Install the project in another directory except C partition :
npx create-react-app learnredux
Then :
npm i react-redux --save
This should work.
The problem is the npm cache by the path of the error. Try running:
npm cache verify
Verify the contents of the cache folder, garbage collecting any
unneeded data, and verifying the integrity of the cache index and all
cached data.
(from https://docs.npmjs.com/cli-commands/cache.html)

A bunch of errors when running npm install

When I run npm install on my xampp laravel setup I get a bunch of errors. log is LONG and shown below. I don't even know where to start
I've tried deleting my node_module folder (that was a random guess, nothing changed)
I've tried to run npm install -g (didn't work either)
I'm installing the root of my project and I've got a composer.json file.
Error log:
Errorlog link
Try just deleting the node-sass folder in node_modules (if it's there), then run npm install node-sass#4.9.2 --save, and run npm install again!

Failed to install react-native-navigation module. Thrown error "ENOENT: no such file or directory"

I tried installing react-native-navigation (by wix) package quite a few times using npm. The process was initiated, but for some reason it was not getting completed. I cancelled it in first attempt, and proceeded with installation again. For some reason npm was unable to install the package and started exiting with following error:
679 error enoent ENOENT: no such file or directory, rename 'D:\Workspace\pokemonn\node_modules\hoist-non-react-statics' -> 'D:\Workspace\pokemonn\node_modules\.hoist-non-react-statics.DELETE'
680 error enoent This is related to npm not being able to find a file.
681 verbose exit [ -4058, true ]
I'm on Window machine, with node 10.x LTS & npm 6.x & react-native 0.57.8 installed.
This issue got resolved much earlier, I forgot to update here.
There was a thread open on github which I found later related to npm installation. After following the steps mentioned, I was able to install it.
Following are the steps:
Delete both node_modules directory, and package-lock.json file from project folder
type npm cache clean --force and hit Enter
type npm install -g react-native-navigation and hit Enter
[More: Github article]

npm - tarball data for material-design-icons seems to be corrupted

I'm having this error while running a npm install material-design-icons#3.0.1:
tarball data for material-design-icons#3.0.1 (sha1-mnHEh0chjrylHlGmbaaCA4zct78=) seems to be corrupted
npm ERR! path D:\speech-analytics\node_modules\.staging\material-design-icons-7d5a1f73\action\drawable-xxhdpi\ic_assignment_ind_white_48dp.png
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'D:\\speech-analytics\node_modules\.staging\material-design-icons-7d5a1f73\action\drawable-xxhdpi\ic_assignment_ind_white_48dp.png'
npm ERR! { Error: EPERM: operation not permitted, unlink 'D:\\speech-analytics\node_modules\.staging\material-design-icons-7d5a1f73\action\drawable-xxhdpi\ic_assignment_ind_white_48dp.png'
Here it's documented as a bug, but still without an answer nor a fix.
I've tried to reinstall node, upgraded to latest npm version (currently running 6.4.1), did a cache clean --force, tried a npm install --no-optional, removed package-lock.json, removed npm & npm-cache folders from AppData directory, running everything as Administrator, but still no luck.
I even tried with material-design-icons#3.0.0 but the error remains.
If I navigate to the folder that appears in the log (node_modules\.staging\material-design-icons-7d5a1f73\action\drawable-xxhdpi), it's empty, and is the only folder that exists in the entire node_modules directory. I can delete that dir without any problems, so it does not seem to be a permissions/lock issue.
Any suggestions?
Finally, I got this fixed by:
Removing node_modules folder
Running npm update
Running npm install
As far I understand, the npm update should have updated the package.json file, but all dependencies kept the same versions as we had it before.
I resolved this with the command: npm cache verify which output:
Cache verified and compressed (C:\Programs\DCPS\npm-cache\_cacache):
Content verified: 1344 (164824963 bytes)
Content garbage-collected: 1 (3491551 bytes)
Index entries: 1522
Finished in 8.187s
The line that stands out to me is: Content garbage-collected: 1 (3491551 bytes)
Does this sort of thing happen because a new version of a package is published to npmjs without a version bump?
No need to run npm update (I didn't want to update any packages) or delete the entire node_modules folder. I solved this by
deleting package-lock.json
deleting node_modules\material-design-icons-xxxxxxx
running npm install again
If npm update is not a solution, and as deleting package-lock.json can bring issues of its own, I could solve it simply by:
deleting the node_modules/ folder
in package-lock.json, deleting the sections referencing to the corrupted package
running npm install again
If you are on windows env, I fixed it by running the cmd as administrator
You need to confirm whether the Typescript is installed and after installing typescript it worked for me
running the below comment will show the typescript version
tsc -v
If it shows some error install the typescript
npm install -g typescript
If then typescript is installed you can try checking the Angular Cli version
ng --version
If it shows some error then install Angular Cli Ref: https://cli.angular.io/
npm install -g #angular/cli
" If you are on windows env, I fixed it by running the cmd as administrator "
This worked for me. However, chromedriver was not installed. So, i installed it separately using the command 'npm install chromedriver'.
None of the answers solved my problem, because in my case was the git. Maybe someone can have the same problem.
I had some dependencies from git in the project and my git was not working on the terminal. So fixing the path for git fixed it!
I had this in Bitbucket Pipeline when using a private package.
I was missing to install git in pipeline:
script:
- apk update && apk upgrade && apk add --no-cache bash git openssh # <- THIS
- npm ci --prefer-offline
Dependency was
"some-private-package": "git+ssh://git#bitbucket.org/workspace/some-private-package#v1.0.12",`
Well I could not resolve this problem with a lot of tries so I made the download of the github ZIP, unzip and install and it worked !
download material-design-icons from github
unzip to the directory of your project (or c:\tmp)
npm install ./material-design-icons
or
npm install c:/tmp/material-design-icons