Home  >  Q&A  >  body text

javascript - weexpack compilation error Cannot find module 'escape-string-regexp'

weexpack@0.4.2
node@7.7.0
npm@5.0.4

运行 npm run serve
出现下面错误
ERROR in ./temp?entry=true
Module 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

学习ing学习ing2640 days ago2429

reply all(4)I'll reply

  • 黄舟

    黄舟2017-06-30 10:01:18

    Enter the following command and try it at startup.

    npm  install --save-dev  escape-string-regexp

    reply
    0
  • typecho

    typecho2017-06-30 10:01:18

    The node_module of your project is missing this module escape-string-regexp
    Try two methods

    1 In the project root directory npm install --save escape-string-regexp
    2 Delete your project’s /node_module, and then re-execute npm install

    Finally, if possible, it is better to use npm instead of cnpm

    reply
    0
  • PHP中文网

    PHP中文网2017-06-30 10:01:18

    Re-run npm install or manually npm install escape-string-regexp

    reply
    0
  • 学习ing

    学习ing2017-06-30 10:01:18

    It should be that the module is not installed and cannot be found.

    reply
    0
  • Cancelreply