0
votes

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

3
What version of npm? With some of the newer 5.x releases, there have been issues on Windows like you're seeing. Try updating to 5.3.0 and see if the errors go away. - Matthew Bakaitis
Additionally if you are using VSCode, it might also be part of the problem. See: github.com/Microsoft/vscode/issues/28593 - Matthew Bakaitis

3 Answers

1
votes

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

0
votes

your path might be incorrect... go to your directory and press right click with shift and select command prompt then execute your command...

0
votes

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.