'npm err! code 1 in the vscode during installation for Angular
I'm trying to execute a code I have downloaded from the github in my machine. I have set the ambient for angular in the vscode and the issue npm ERR! code 1 is keep showing up. I've tried some alternative during a search in the stack overflow with no success.. bellow is the erro I hope some one is familiar with the solution.
PS C:\Users\cborge14\Documents\L&D\pdAcademy\pdacademy-frontend-angular> npm i
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm ERR! code 1
npm ERR! path C:\Users\cborge14\Documents\L&D\pdAcademy\pdacademy-frontend-angular\node_modules\@parcel\watcher
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp-build
npm ERR! 'D\pdAcademy\pdacademy-frontend-angular\node_modules\.bin\' is not recognized as an internal or external command,
npm ERR! operable program or batch file.
npm ERR! node:internal/modules/cjs/loader:936
npm ERR! throw err;
npm ERR! ^
npm ERR!
npm ERR! Error: Cannot find module 'C:\Users\cborge14\Documents\node-gyp-build\bin.js'
npm ERR! at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
npm ERR! at Function.Module._load (node:internal/modules/cjs/loader:778:27)
npm ERR! at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
npm ERR! at node:internal/main/run_main_module:17:47 {
npm ERR! code: 'MODULE_NOT_FOUND',
npm ERR! requireStack: []
npm ERR! }
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\cborge14\AppData\Local\npm-cache\_logs\2022-05-06T22_29_27_170Z-debug-0.log
Thanks in advance
Solution 1:[1]
For solving this problem, first remove the node_modules folder if it exists in your project solutions then clear you npm cash. you could do that with command or just remove the npm-cache folder at this directory:
C:\Users\'your-user-name'\AppData\Roaming
or
C:\Users\user\AppData\local
After these steps, the npm command should work properly.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Tyler2P |
