pnmp falied to install local tgz file in package.lock.json - npm

when I run pnpm install it report this error
 ERR_PNPM_FETCH_404  GET https://registry.npmjs.org/nodename1: Not Found - 404
This error happened while installing the dependencies of nodename2
nodename1 is not in the npm registry, or you have no permission to fetch it.
I checked the lock file founded that nodename1 and nodename2 uses "resolved": "file:.folder/nodename.tgz",.
I can install this in npm successfully.
How can I handel this problem in pnpm?

Related

Unable to install firebase through npm

have been trying to install firebase through npm
using,
Npm install --save firebase
then it return an error saying
unexpected end of file while parsing input 3434DFDFSDFSGF.. and so on
and have tried diiferent solution on this platfoam such as
Npm cache clean --force
cache verify and so on...
please help...
Delete node_modules folder, go to package.json file add "firebase": "^7.7.0", in dependencies. You can which ever version is required.
Then run command npm install.
If this doesn't work check node js version. Check if your node js version is supported or not by firebase version which is intalled.

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!

npm cannot install some packages globally and locally?

I'm developing some JavaScript application with VSCode editor, and it says cannot find ESlint package. So i tried install it locally on app directory and globally, but both methods are failed. It gives following error(log file) and stops installation.
silly fetchPackageMetaData error for emoji-regex#^7.0.1 Unexpected end of JSON input while parsing near '...gex-7.0.1.tgz","fileC'
i tried to install package that causes the error and it also get failed, i cleared cache of npm with npm cache clean --force and re-install eslint package. And it worked.

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