鍍金池/ 問答/HTML5  Linux  HTML/ npm 安裝了一個(gè)依賴 怎么徹底卸載

npm 安裝了一個(gè)依賴 怎么徹底卸載

回復(fù):

clipboard.png

更新問題:
packages.json:

{
    "name": "rn",
    "version": "0.0.1",
    "private": true,
    "scripts": {
        "start": "node node_modules/react-native/local-cli/cli.js start",
        "test": "jest"
    },
    "dependencies": {
        "crypto-js": "^3.1.9-1",
        "react": "16.0.0-beta.5",
        "react-native": "0.49.1",
        "react-native-image-zoom-viewer": "^2.0.12",
        "react-native-keyboard-aware-scroll-view": "^0.4.1",
        "react-native-lahk-marquee-label": "^1.1.3",
        "react-native-lightbox": "^0.7.0",
        "react-native-modal-datetime-picker": "^4.13.0",
        "react-native-orientation": "^3.1.0",
        "react-native-scrollable-tab-view": "^0.8.0",
        "react-native-simple-store": "^1.3.0",
        "react-native-storage": "^0.2.2",
        "react-native-swipeout": "^2.3.1",
        "react-native-swiper": "^1.5.13",
        "react-navigation": "^1.0.0-beta.19"
    },
    "devDependencies": {
        "babel-jest": "21.2.0",
        "babel-preset-react-native": "4.0.0",
        "jest": "21.2.1",
        "react-test-renderer": "16.0.0-beta.5"
    },
    "jest": {
        "preset": "react-native"
    }
}

clipboard.png
如圖 我的確是裝了一個(gè)react-native-htmltext組件
安裝的命令:npm i react-native-htmltext --save
但是這個(gè)組件自己帶了一個(gè)react-native模塊
恰好 我錯(cuò)了 我不想用這個(gè)組件
我就用npm uninstall react-native-htmltext --save卸載了組件
但是一直報(bào)這個(gè)錯(cuò),怎么也不能解決
而且我的電腦那個(gè)文件路徑都沒有的
我重啟電腦也沒作用
我嘗試執(zhí)行npm remove react-native-htmltext 也沒作用?。?!
怎么辦呢!

回答
編輯回答
有你在

npm uninstall [要卸載的模塊]

2018年1月6日 12:55
編輯回答
陌如玉

刪除node_modules目錄,和package.json中的依賴,重新執(zhí)行npm install

2017年12月28日 05:10
編輯回答
詆毀你

已經(jīng)解決了在google中找到答案:
在控制臺(tái)執(zhí)行這個(gè)命令:

yarn start --reset-cache
2018年9月20日 05:23
編輯回答
孤影

最簡(jiǎn)單的方式就是 rm -rf node_modules,然后再npm install

2018年4月30日 15:50
編輯回答
傻叼

考慮下可能得緩存,uninstall后使用npm clean cache --force試試。然后安裝。

2017年12月28日 07:08