javascript - weexpack編譯出錯(cuò) Cannot find module ’escape-string-regexp’
問(wèn)題描述
weexpack@0.4.2node@7.7.0npm@5.0.4
運(yùn)行 npm run serve出現(xiàn)下面錯(cuò)誤ERROR in ./temp?entry=trueModule build failed: Error: Cannot find module ’escape-string-regexp’ (While processing preset: '/Users/pengwei/node_modules/babel-preset-es2015/lib/index.js')
at Function.Module._resolveFilename (module.js:470:15)at Function.Module._load (module.js:418:25)at Module.require (module.js:498:17)at require (internal/module.js:20:19)at Object.<anonymous> (/Users/pengwei/node_modules/babel-template/node_modules/chalk/index.js:2:26)at Module._compile (module.js:571:32)at Object.Module._extensions..js (module.js:580:10)at Module.load (module.js:488:32)at tryModuleLoad (module.js:447:12)at Function.Module._load (module.js:439:3)
@ multi (webpack)-dev-server/client?http://192.168.1.108:8080/web ./temp?entry=true
問(wèn)題解答
回答1:輸入以下命令,然后在啟動(dòng)試試看。
npm install --save-dev escape-string-regexp回答2:
你項(xiàng)目的的node_module下少了這個(gè)模塊escape-string-regexp2個(gè)辦法你試試
1 在項(xiàng)目根目錄下 npm install --save escape-string-regexp2 刪除你項(xiàng)目的/node_module,然后重新執(zhí)行npm install
最后,有條件最好使用npm而不是cnpm
回答3:重新跑一邊npm install 或者 手動(dòng) npm install escape-string-regexp
回答4:應(yīng)該是沒(méi)有安裝模塊,導(dǎo)致找不到。
相關(guān)文章:
1. mysql - 表名稱(chēng)前綴到底有啥用?2. 怎么php怎么通過(guò)數(shù)組顯示sql查詢結(jié)果呢,查詢結(jié)果有多條,如圖。3. 在mybatis使用mysql的ON DUPLICATE KEY UPDATE語(yǔ)法實(shí)現(xiàn)存在即更新應(yīng)該使用哪個(gè)標(biāo)簽?4. mysql - 數(shù)據(jù)庫(kù)表中,兩個(gè)表互為外鍵參考如何解決5. 為什么php修改數(shù)據(jù)無(wú)法同步到數(shù)據(jù)庫(kù),只是當(dāng)前頁(yè)面修改成功?6. 編輯成功不顯示彈窗7. sublime可以用其他編譯器替換嗎?8. tp 6.0 數(shù)據(jù)查詢,求教!9. sql語(yǔ)句 - 如何在mysql中批量添加用戶?10. 哭遼 求大佬解答 控制器的join方法怎么轉(zhuǎn)模型方法
