npm -v Error: ENOENT: no such file or directory, mkdir 'E:\' 6.14.4 - vue.js

I just installed NPM. I don't know what to do. I've checked it all afternoon. Help me. Thank you. I've reinstalled it several times and tried many solutions. It's not easy.
I've tried the following
npm rebuild node-sass
npm install npm -g
sudo npm install -g npm
npm install -g npm
npm cache clear
npm cache verify
Npm install -g bower
Whatever I type, he answers me
Error: ENOENT: no such file or directory, mkdir 'E:\'
I'm really upset. Please help me
I've seen people say that re downloading can solve the problem. But clean up the registry. So I did it according to the plan, uninstalled node, downloaded regclean pro, and cleaned the registry. But it's still useless. I'll check the others. I sincerely look forward to your help.

The problem has been solved. I also tried to modify D: \ nodejs \ node_ Under modules \ NPM
. npmrc file.
Finally, modify the. Npmrc file under C: \ users \ administrator
prefix=D:\ node.js \node_ global
cache=D:\ node.js \node_ cache
registry= http://registry.cnpmjs.org/
python=python2.7
msvs_ version=2015
It's done

Related

NPM insists on using the wrong registry URL

Using NPM to install dependencies, including one that is stored in Verdaccio running locally.
Somehow NPM is stuck attempting to load the Verdaccio dependency from localhost even though the command to install from the corrected location has been run npm install --save --registry http://CORRECT-URL ...
Using rm -rf node_modules package-lock.json and removing the dependency from package.json, then running the install again - still DOES NOT WORK. Every time the install command completes, package-lock.json STILL uses localhost to resolve the registry.
Removing localhost from ~/.npmrc and running npm set registry http://CORRECT-URL also didn't help.
Please help. Where is NPM remembering localhost and insisting on using it???
UPDATE - Using npm install -ddd
Attempted to use npm install -ddd to see where npm is picking up the package. The output shows the CORRECT-URL, but when it is done, package-lock.json still lists localhost.
Note all of the following:
Removed all references to the PACKAGE from package.json and package-lock.json
Verified no references to localhost in either file
Removed node_modules/PACKAGE_DIR with rm -rf
Removed PACKAGE from node_modules/.package-lock.json
Searched for .npmrc and npmrc in the build tree and found two empty files:
node/node_modules/npm/docs/public/configuring-npm/npmrc
node/node_modules/npm/.npmrc
~/.npmrc has 2 entries for the CORRECT_URL in the following forms:
//:/:_authToken="<AUTH_TOKEN>"
registry=http://:/
Stumbled upon this post while trying to debug the exact same situation. What ended up solving this for me was to blow out package-lock, run npm rebuild, then npm install --registry . Hope this helps someone in the future!

NPM global package install not working properly

Tearing my hair out over this.
I used to have a npm package called 'eleventy' installed globaly and working on my laptop. Today I find this: fish: Unknown command 'eleventy'
Tried this npm install -g eleventy and got this
+ eleventy#0.2.0
updated 1 package in 0.289s
Things tried from other posted questions:
npm get prefix outputs /usr/local
ls /usr/local/lib/node_modules/ outputs eleventy npm
but not eleventy found in /usr/local/bin
echo $PATH = /usr/local/php5/bin/ /usr/local/bin /usr/local/lib /usr/bin /bin /usr/sbin /sbin
Tried reinstalling npm and nodejs as well but no luck so far. Any help appreciated.
Okay, looks like I'm an idiot. I was installing the wrong package with a similar name.
I needed to use
npm install -g #11ty/eleventy

npm: Unhandled rejection Error: EISDIR: illegal operation on a directory, open ‘/Users/me/.npm/_cacache/content-v2/sha512/b3/da’

On my Mac, I just updated my working npm version from 5.6 to 6.9 thusly:
sudo npm i -g npm
Then I tried to install cordova like this:
sudo npm install -g cordova
And get
Unhandled rejection Error: EISDIR: illegal operation on a directory,
open '/Users/me/.npm/_cacache/content-v2/sha512/04/89'
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! <https://npm.community>
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/me/.npm/_logs/2019-04-02T11_50_57_678Z-debug.log
I tried to downgrade thusly:
sudo npm install -g npm#6.4.1
but this fails with hundreds of lines like this:
npm WARN tar EISDIR: illegal operation on a directory, open '/tmp/npm-30934-a3ac319a/unpack-28da209e/bin/node-gyp-bin'
Unhandled rejection Error: EISDIR: illegal operation on a directory, open '/Users/me/.npm/_cacache/content-v2/sha512/99/72'
I also tried making sure the ownership was correct:
sudo chown -R $(whoami) ~/.npm
There are lots of posts of various EISDIR (error is a directory) problems for other directories (such as /usr/lib/modules), but no solutions seem to work.
Also, the npmrc file does not seem to exist. If I do:
npm config ls -l
globalconfig = "/usr/local/etc/npmrc"
userconfig = "/Users/me/.npmrc"
but neither file exists.
Note, I dont have homebrew, and didnt install it that way (I usually do manual installs).
I also tried this:
sudo npm cache clean -f
This did not help.
What else can I try? should I try deleting the ~/.npm dir?
Looking for a way to uninstall node, I found many old posts with long and sometimes conflicting lists of files to remove. Not sure if this will make it worse.
Any suggestions?
I think I have found a solution. I did the following:
installed node from the Mac pkg installer from https://nodejs.org/en/ This downgraded npm to 6.4.1 which is the version before EISDIR problems start apparently.
chmod -R 777 ~/.npm/_cacache // yes, this is not good
chown -R me ~/.npm/_cacache
After this, I could install cordova using "sudo npm install -g cordova" without errors.
I had the same problem when I upgraded to npm 6.9.0. You have to upgrade node to the last version:
brew reinstall node
At this time I have installed the latest available version for Mac OS Mojave (node: v11.14.0 and npm 6.9.0).
After node upgrade, I was able to install packages globally again.
Changing the ownership of files and then avoiding the use of sudo is a possible workaround for EISDIR with global installs using sudo. I suppose you have installed to default location folder:
sudo chown -R <user> ~/.npm
sudo chown -R <user> /usr/local/lib
sudo chown -R <user> /usr/local/bin
After this sequence, it worked to me.

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

How to fix EACCES issues with npm install

Some of my node modules get installed but there are always these sort of issues on this particular linux mint machine
npm install
npm ERR! Error: EACCES, open '/home/me/.npm/semver/3.0.1/package/package.json'
npm ERR! { [Error: EACCES, open '/home/me/.npm/semver/3.0.1/package/package.json']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/home/me/.npm/semver/3.0.1/package/package.json',
npm ERR! parent: 'gulp' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
This code fix it for me.
sudo chown -R `whoami` ~/.npm
sudo chown -R `whoami` /usr/local/lib/node_modules
UPDATE. See
this answer
for a better way.
You have to set correct permissions (ownership) so npm can access your (sub)directories with your normal user permissions:
sudo chown -R $USER <directory>
where in your case <directory> is /home/me and -R is for recursive to also change ownership of all your subdirectories, which is exactly what you want. That should fix the EACCESS issue.
Sadly the advise to run the command as root/Administrator is wrong here.
You want to avoid running npm with sudo ever, as recommended by the npm creator Isaac Schlueter:
I strongly encourage you not to do package management with sudo! Packages can run arbitrary scripts, which makes sudoing a package manager command as safe as a chainsaw haircut. Sure, it’s fast and definitely going to cut through any obstacles, but you might actually want that obstacle to stay there.
See here for more details.
Add sudo before npm install . It will permit access to write .
sudo npm install [name of package].
Try to use "sudo npx create-react-app app-name"
it may still show error because some dependencies may be mising but a directory and the necessary files maybe created.
Set the correct permission to access the necessary directories.
In my case (Node & NPM Installation via Brew) on BigSur:
sudo chown -R $USER /Users/YOUR_USERNAME/node_modules
If you are still facing problem after running :
sudo chown -R `whoami` ~/.npm
sudo chown -R `whoami` /usr/local/lib/node_modules
Run the npm install command with :
--unsafe-perm
which will help you in installing the package with out any problem.
To minimize the chance of permissions errors, you can configure npm to use a different directory. In this example, you will create and use hidden directory in your home directory.
Back up your computer.
On the command line, in your home directory, create a directory for global installations:
mkdir ~/.npm-global
Configure npm to use the new directory path:
npm config set prefix '~/.npm-global'
In your preferred text editor, open or create a ~/.profile file and add this line:
export PATH=~/.npm-global/bin:$PATH
On the command line, update your system variables:
source ~/.profile
To test your new configuration, install a package globally without using sudo:
npm install -g jshint
(ref: https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally)
Running the code in sudo mode have fixed the problem for me
$ sudo npm install -g nativefier
And if you have related issues like package unmet dependencies check out this link
in windows run cmd as administrator and then try:
npm install -g <package-name>
in mac os or linux try:
sudo npm install -g <package-name>
I understand one might be suspicious about changing the ownership of folders situated in the system files. But it's completely safe, they are meant to host processes that you can use without sudo. So I prefer this solution because it's good and will guarantee compatibility after.
sudo chown -R $USER /usr/local/bin
sudo chmod -R 0775 /usr/local/bin
sudo chown -R $USER /usr/local/lib/node_modules
sudo chmod -R 0775 /usr/local/lib/node_modules
If you installed a new version of node.js, you could still get some error. Try deleting the npm cache:
sudo npm cache clear
To permanently fix this problem, please run:
sudo chown -R 1000:1000 "/home/$USER/.npm"
sudo npm install -g create-react-app
just adding sudo before nmp install will give superuser privilages to run npm and that would not cause any erros while it want to alter a file or access it. well, i hope this might help you!
I had the Similar Problem when I typed:
npm install -g create-react-app
The Terminal replied:
npm ERR! code EACCES
....
So I add "sudo" like This:
sudo npm install -g create-react-app
And problem Solved!! :-)
(So I am agree with "chethan chandan" about using "sudo")