Introduction
Recently, I’ve faced different issues when tryng npm install
in some of the project I’ve been working with.
Environment
- Windows 10 (OS Build 15063.413)
- Node version: 8.1.2
- NPM version: 5.0.3
Every time I tried npm install or install a isolated package I got errors like this one:
Problem
1 | _npm ERR! path \GitHub\react-typescript-webpack2-cssModules-postCSS\node_modules\ts-loader |
Solution
The solution for my specific scenario was:
1. Close VS Code
2. Remove package-lock.json, node_modules and npm cache
1
2
3
4# Windows
del package-lock.json
rd /s /q node_modules
npm cache clear --force
1 | # macOs |
3. Retry npm i
Read more…
If you still have this problem, read this: https://github.com/npm/npm/issues/10826
All articles in this blog are licensed under CC BY-SA 4.0 unless stating additionally.