`npm install` gives ENOENT errno -2 re missing dezalgo module - npm-install

I'm trying to run npm install for a little ember-driven site that I've got, but it throws the following error:
npm ERR! path /Projects/Etc/Admin/cuscus/node_modules/npm/node_modules/dezalgo
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/Projects/Etc/Admin/cuscus/node_modules/npm/node_modules/dezalgo' -> '/Projects/Etc/Admin/cuscus/node_modules/npm/node_modules/.dezalgo.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/mick/.npm/_logs/2018-01-09T01_18_51_322Z-debug.log
If I delete the node_modules directory completely then run npm install again it seems to work, but running it again fails.

What you can try is:
Be sure that you use cmd promt in Admin mode.
If you use VS Code, kill all node procceses. Close it and try again.
Delete package-lock.json and node-modules folder and try again.
Change the node version. For example try the old one v6.11.2
Try to do npm cache clean --force
Try to remove {package}.DELETE in ~/AppData/Roaming/npm/node_modules after the initial npm i -g {package} and retry npm i -g {package}
One of it can help. But not for sure. The status of issue with this problem is open for the moment.
https://github.com/npm/npm/issues/17444

I just had this issue when setting up a new machine. None of the cache clean/uninstall/reinstall steps worked for me.
However, I was able to resolve it by updating npm to the latest version. I had 5.6.0 installed, but using npm-windows-upgrade to install the latest version (5.7.1) cleared up the dependency issues.
See this answer for more information on upgrading npm on Windows:
https://stackoverflow.com/a/31520672/91189

This most likely happened because you updated your node version and because you probably already had this repo sitting on your machine before that particular update, the package-lock.json file whose sole purpose is to track the present and past state of your node_modules file and maintain a very updated dependency tree such that amongst entities using your code there will be consistency installing exactly the same dependencies ;
Entities using your code include
Teammates
Deployments (AWS ECS),
and Continuous integration tools like Travis CI that are running your code,
Try to delete the package-lock.json file. Run the npm install command and you should be fine.
The last thing you should try doing is deleting the missing package if you are not sure of what you are doing, it's usually better to avoid this.
Goodluck.

Related

npm ERR! code ENOLOCAL while running npm install

I am facing the error below, I tried clear the cache and install npm latest but all are no use to me, may I know is there any way to resolve it?
> npm install
npm ERR! code ENOLOCAL
npm ERR! Could not install from "node_modules\tui-editor\squire-rte#github:seonim-ryu\Squire#fd40b4e3020845825701e9689f190bab3f4775d4" as it does not contain a package.json file.
you should try to delete node modules folder repeatedly and reinstall packages by npm install command
npm cache clean try this command after deleted node modules

I cannot install npm with node, any ideas? [duplicate]

I keep getting the same error message when trying to create a new angular project.
I tried to create a new angular project using Windows Powershell with the following commands:
ng new hello-world
-> Would you like to add angular routing? - Yes
-> Stylesheet format? - CSS
I obtained the error message below. I already tried to reinstall angular cli and I'm running Powershell using Administrator.
Installed versions:
Angular CLI: 8.0.6
Node: 10.16.0
OS: win32 x64
Error message:
npm WARN tarball data for tslint#~5.15.0 (sha512-6bIEujKR21/3nyeoX2uBnE8s+tMXCQXhqMmaIPJpHmXJoBJPTLcI7/VHRtUwMhnLVdwLqqY3zmd8Dxqa5CVdJA==) seems to be corrupted. Trying one more time.
npm WARN tarball tarball data for jasmine-spec-reporter#~4.2.1 (sha512-FZBoZu7VE5nR7Nilzy+Np8KuVIOxF4oXDPDknehCYBDE080EnlPu0afdZNmpGDBRCUBv3mj5qgqCRmk6W/K8vg==) seems to be corrupted. Trying one more time.
npm WARN tarball tarball data for acorn#^6.0.5 (sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==) seems to be corrupted. Trying one more time.
npm WARN tarball tarball data for #angular/language-service#~8.0.3 (sha512-04XojOo9FJgEQE/rZafnaJQxPEU+//TSzTgpGoIVzCSMx+joCY/ZSSwJZPWxiHlOE57W/zX02ZY+TwcM81oTdw==) seems to be corrupted. Trying one more time.
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\konta\Desktop\Programming_files\Angular\hello-world\node_modules\.staging\#angular\platform-browser-447d0944\esm2015\animations\src\animation_builder.js'
npm ERR! path C:\Users\konta\Desktop\Programming_files\Angular\hello-world\node_modules\.staging\jasmine-spec-reporter-cbb15ffc\screenshot.gif
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'C:\Users\konta\Desktop\Programming_files\Angular\hello-world\node_modules\.staging\jasmine-spec-reporter-cbb15ffc\screenshot.gif'
npm ERR! { [Error: EPERM: operation not permitted, unlink 'C:\Users\konta\Desktop\Programming_files\Angular\hello-world\node_modules\.staging\jasmine-spec-reporter-cbb15ffc\screenshot.gif']
npm ERR! cause:
npm ERR! { Error: EPERM: operation not permitted, unlink 'C:\Users\konta\Desktop\Programming_files\Angular\hello-world\node_modules\.staging\jasmine-spec-reporter-cbb15ffc\screenshot.gif'
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path:
npm ERR! 'C:\\Users\\konta\\Desktop\\Programming_files\\Angular\\hello-world\\node_modules\\.staging\\jasmine-spec-reporter-cbb15ffc\\screenshot.gif' },
npm ERR! stack:
npm ERR! 'Error: EPERM: operation not permitted, unlink \'C:\\Users\\konta\\Desktop\\Programming_files\\Angular\\hello-world\\node_modules\\.staging\\jasmine-spec-reporter-cbb15ffc\\screenshot.gif\'',
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path:
npm ERR! 'C:\\Users\\konta\\Desktop\\Programming_files\\Angular\\hello-world\\node_modules\\.staging\\jasmine-spec-reporter-cbb15ffc\\screenshot.gif',
npm ERR! parent: 'hello-world' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
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 WARN tar EPERM: operation not permitted, lstat 'C:\Users\konta\Desktop\Programming_files\Angular\hello-world\node_modules\.staging\#angular\router-8388bfd5\esm2015\src\directives'
npm WARN tarball tarball data for typescript#3.4.4 (sha512-xt5RsIRCEaf6+j9AyOBgvVuAec0i92rgCaS3S+UVf5Z/vF2Hvtsw08wtUTJqp4djwznoAgjSxeCcU4r+CcDBJA==) seems to be corrupted. Trying one more time.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\konta\AppData\Roaming\npm-cache\_logs\2019-07-01T01_21_13_653Z-debug.log
Package install failed, see above.
I found the problem: My antivirus was somehow blocking the files without me knowing. It worked once I paused my antivirus during the installation.
In windows10 I disabled the windows defender / windows security ==> realtime protection and try again npm install command and it worked
1.
2.
3.
NOTE : Turn on the real time protection again after installation complete.
Restarting the machine worked for me.
I had this problem on MAC. I just added 'sudo' before the command and it worked.
sudo npm install -g parcel-bundler
I tried opening CMD with Run as Admisnistrator then run npm i and it worked for me
I'd just like to add a small little answer based on Qadir Hussain's answer.
If you disable "Realtime Protection" in Windows Security, you're going to leave your laptop or PC vulnerable to any viruses that may infect it when "Realtime Protection" is off. This may seem a bit impossible if you're only installing an NPM package, but some apps may have a hidden background process waiting for "Realtime Protection" to be disabled, and when it is, it could inject a virus.
That been said, there's still an option.
First things first, open Windows Security by typing "Windows Security" in the Start Menu and tap "Open".
After that, go to "Virus & Threat Protection".
Next, scroll down until you find "Manage Settings" under "Virus & Threat Protection Settings".
Then, scroll down until you see "Exclusions". Under "Exclusions" there's a link that says "Add or remove exclusions".
Once that's done, tap the button that says "Add an exclusion". Then tap "Folder" on the drop-down menu.
Choose the node_modules directory that is giving issues.
Last but not least, Allow administrative permissions.
Finally, exit Windows Security.
I wouldn't recommend excluding your entire Projects folder, as that will disable all scans for the directory.
Small disclaimer here, I'm only making this answer as a means of helping others without disabling "Realtime Protection". While I'm not encouraging this, this might help fix a common problem.
Have a good day. :)
For me, there are several possibilities:
Intercepted by anti-virus software, resulting in inoperability.
It is locked by IDE, resulting in inoperable.
The task is locked by npm running, resulting in inoperable.
Cancelling the npm start process and closing the terminal window (I use Hyper Terminal) worked for me (using Win 10).
I was then able to uninstall an npm package and install another.
I had visual studio code running. I turned it off and boom! worked for me!
To me, using Windows 10 the only thing that solved this problem was: exclude the node_modules folder, open Visual Studio Code in Admin mode in the project folder, and execute the following command:
npm install -g --unsafe-perm
For me the issue was with npm version I was using. I changed to a npm version which did not have the bug by using the below command:
npm install --global npm#8.3.1
I found this solution in a github issue:
Link to github issue
Hope it helps you like it did me!
was facing this problem and this is how it got solved :
-stoping the execution of the development server for both front-end and backend:
two things:
try admin.
make sure other processes does not occupying the folder/file
with me, it was not related to antivirus.
it appears that a process occupied this folder. in my case a node process occupied my node_modules folder.
i found it out by using process-explorer - i searched the path end found that a node process using this folder(even though I closed it! very common in windows), so i ended this process and then i did not got this error anymore.
I had the same issue What I have done wrong is I had set the npm registry to a local registry, without knowing that I faced this issue once I reset to globally using npm config set registry https://registry.npmjs.org/ error went away.
I tried everything above.
Deleting node_modules and re-installing did the trick for me.
This happened when I tried installing a new npm dependency, jest, with:
npm i --save-dev jest
I got it working by simply rerunning the command.

"PulseTile-RA" cannot run. Is it an npm dependency issue?

I wanted to experiment with this project based on react-admin:
https://github.com/PulseTile/PulseTile-RA
So I downloaded the code, run npm install and I got a lot of errors from NPM mainly axios version corrupted.
Example:
npm ERR! code EINTEGRITY
npm ERR! sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI= integrity checksum failed when using sha1: wanted sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI= but got sha512-0BfJq4NSfQXd+SkFdrvFbG7addhYSBA2mQwISr46pD6E5iqkWg02RAs8vyTT/j0RTnoYmeXauBuSv1qKwR179g== sha1-/z8N4ue10YDnV62YAA8Qgbh7zqM=. (75833 bytes)
npm WARN tarball tarball data for js-yaml#3.13.1 (sha512-pZZoSxcCYco+DIKBTimr67J6Hy+EYGZDY/HCWC+iAEA9h1ByhMXAIVUXMcMFpOCxQ/xjXmPI2MkDL5HRm5eFrQ==) seems to be corrupted. Trying one more time.
npm ERR! code EINTEGRITY
npm ERR! sha512-pZZoSxcCYco+DIKBTimr67J6Hy+EYGZDY/HCWC+iAEA9h1ByhMXAIVUXMcMFpOCxQ/xjXmPI2MkDL5HRm5eFrQ== integrity checksum failed when using sha512: wanted sha512-pZZoSxcCYco+DIKBTimr67J6Hy+EYGZDY/HCWC+iAEA9h1ByhMXAIVUXMcMFpOCxQ/xjXmPI2MkDL5HRm5eFrQ== but got sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==. (74050 bytes)
npm WARN tar ENOENT: no such file or directory, open 'C:\nodejs\xxx\PulseTile-RA\node_modules\.staging\babel-plugin-transform-object-rest-spread-7e34a6f0\package.json'*
When I do npm start I get an error that react-scripts doesn't exist.
I tried workarounds for similar errors on stackoverflow but without success. And yet still, I cannot get it to run. I have latest NPM, node on windows 10.
Please advise on NPM issues as I think this is the source of this project issue of not starting.
Thank you
So technically, this has more to do with npm than the actual project.
In fact, this issue reported to the npm repository would help.
But here are some quick steps that should help:
Since you're in windows-10, it's advisable to run the "delete" commands within git bash.
Go to the project directory (root folder)
Delete the node_modules directory: rm -rf node_modules
Delete package-lock.json file:rm package-lock.json`
Clear the cache: npm cache clean --force
Run npm install --verbose
If it doesn't help, then please follow more instructions here

NPM Error code when trying to run npm start

I keep getting the npm ENOENT error when I try to run npm start. I'm not sure what to do to fix this issue.
I have tried to change permissions for folders.
bryantcaruthers-> npm start
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /Users/bryantcaruthers/workshop-vs-code-can-do-that/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/Users/bryantcaruthers/workshop-vs-code-can-do-that/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/bryantcaruthers/.npm/_logs/2019-11-06T03_31_38_233Z-debug.log
Be able to run npm start with no errors.
The error is that there is no package.json file in the directory you are running the code in:
no such file or directory, open /Users/bryantcaruthers/workshop-vs-code-can-do-that/package.json
Are you expecting a package.json file in that directory? Or should you be running npm start from somewhere else?
You can resolve that issue by following methods:
Ensure dependencies described correctly on package.json
Just run
npm install
Check issue still exists. and If issue not resolved, continue these methods.
npm cache clean
sudo npm install -g npm
npm cache clean
npm install
I found solution to this error. This error mostly occurs because you are not working on the right folder, cd to the right folder where you installed the npm or you can open the folder with vs code. For example, you have a main folder that contains the site or app folder, you need to be working from the subfolder and not the main folder, this is where you installed the npm and the dependencies are described correctly on package.json.
Your project workshop-vs-code-can-do-that does not have a packeage.json file available, to create it, go to terminal (on your project path), run this command
npm init -y
Encountered the same error.
Root Cause:
Not installing(npm i) and starting(npm start) from the correct path in terminal
Solution:
Change the directory to the application directory where package.json
present
hope this might help, Thanks.

After running command "npm i" I started getting multiple error

I am facing this issue after I ran npm i command by following THIS THREAD. Now when I am trying to install various dependency for my project, I am getting bunch of errors:
λ npm install -g
npm WARN
D:\ITC\node_modules\#microsoft\sp-lodash-subset\node_modules\lodash
is not a child of C:\Users\xxxxx\AppData\Roaming\npm
npm ERR! path
D:\ITC\node_modules\#microsoft\sp-lodash-subset\node_modules\lodash
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename
'D:\ITC\node_modules\#microsoft\sp-lodash-subset\node_modules\lodash'
-> 'D:\ITC\node_modules\#microsoft\sp-lodash-subset\node_modules.lodash.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR!
C:\Users\xxxxx\AppData\Roaming\npm-cache_logs\2017-07-26T12_26_10_273Z-debug.log
This is a common issue in the new version of npm. It has been brought to their attention. I believe you can fix the issue by creating a new root directory for your project and paste everything but your node_modules folder in it. Then try npm install
your path might be incorrect...
go to your directory and press right click with shift and select command prompt then execute your command...
I faced the same issue with npm. In my situation I had the project folder on Github. Please delete the local copy of the project folder entirely. Clone the project again to local and run the npm i command inside the project directory.
I am assuming you are trying to install the packages installed in dependencies mentioned in package.json.
I used VSCode in administrator mode,
have windows 10 :build 19041.508 and
Using WSL 2.0.