Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't find module : ../../../../node_modules/moment/moment.js #4559

Closed
anonymous-qsh opened this issue Oct 3, 2019 · 2 comments
Closed

can't find module : ../../../../node_modules/moment/moment.js #4559

anonymous-qsh opened this issue Oct 3, 2019 · 2 comments

Comments

@anonymous-qsh
Copy link

问题描述
当我引入moment这个库的时候报错, 错误提示
WAService.js:1 Uncaught Error: can't find module : ../../../../node_modules/moment/moment.

复现步骤

  1. run 'npm install moment --save'
  2. import moment module for any page
const moment = require('moment')
// import moment from 'moment'
// import * as moment from 'moment' 这种方式引入的时候不报错, 一旦使用还是报错

期望行为
这个模块应该可以被正常使用.

报错信息

WAService.js:1 Uncaught Error: can't find module : ../../../../node_modules/moment/moment.js
at WAService.js:1
at index.js:17
at require (WAService.js:1)
at :155:7
at HTMLScriptElement.scriptLoaded (appservice?t=1570089459960:3604)
at HTMLScriptElement.script.onload (appservice?t=1570089459960:3616)

系统信息

Taro v1.2 及以上版本已添加 taro info 命令,方便大家查看系统及依赖信息,运行该命令后将结果贴下面即可。

👽 Taro v1.3.19

Taro CLI 1.3.19 environment info:
System:
OS: macOS 10.14.6
Shell: 5.3 - /bin/zsh
Binaries:
Node: 11.7.0 - ~/.nvm/versions/node/v11.7.0/bin/node
Yarn: 1.13.0 - ~/.nvm/versions/node/v11.7.0/bin/yarn
npm: 6.11.3 - ~/.nvm/versions/node/v11.7.0/bin/npm

报错程序 微信小程序

@taro-bot
Copy link

taro-bot bot commented Oct 3, 2019

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@anonymous-qsh
Copy link
Author

删除dist, 和所有node_modules重新安装后解决了.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant