javascript - weexpack编译出错 Cannot find module 'escape-string-regexp'
学习ing
学习ing 2017-06-30 09:59:18
[JavaScript讨论组]

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
学习ing

全部回复(4)
黄舟

输入以下命令,然后在启动试试看。

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

你项目的的node_module下少了这个模块escape-string-regexp
2个办法你试试

1 在项目根目录下 npm install --save escape-string-regexp
2 删除你项目的/node_module,然后重新执行npm install

最后,有条件最好使用npm而不是cnpm

PHP中文网

重新跑一边npm install 或者 手动 npm install escape-string-regexp

学习ing

应该是没有安装模块,导致找不到。

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号