之前使npm install 正常
突然就報如下錯誤
D:\code\myNode>npm install axios
npm WARN checkPermissions Missing write access to D:\code\myNode\node_modules\ms
npm WARN checkPermissions Missing write access to D:\code\myNode\node_modules\debug
npm WARN checkPermissions Missing write access to D:\code\myNode\node_modules\is-buffer
npm WARN mynode@1.0.0 No repository field.
npm ERR! path D:\code\myNode\node_modules\ms
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall access
npm ERR! enoent ENOENT: no such file or directory, access 'D:\code\myNode\node_modules\ms'
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\lary\AppData\Roaming\npm-cache\_logs\2019-01-07T02_23_08_540Z-debug.log
D:\code\myNode>npm update
嘗試升級node版本也不行
然后查閱資料結論:
解決辦法
刪除掉 C:\Users\dd\AppData\Roaming\npm-cache\
C:\Users\dd\AppData\Roaming\npm\ 兩個文件夾 重新執行 npm install -g
我刪掉了npm-cache文件后,再執行install 相關命令 OK