『编译报错』
[Error] TypeError: Cannot read property 'dir' of undefined
at /usr/local/lib/node_modules/wepy-cli/lib/compile-script.js:207:96
at String.replace (
也有这个问题
+1,求解答
希望能提供一份可重现的代码方便我去定位。
类似问题:
/Users/grace/.nvm/versions/node/v8.9.4/lib/node_modules/wepy-cli/lib/compile.js:132
if (wpy[t]) {
^
TypeError: Cannot read property 'script' of null
at /Users/grace/.nvm/versions/node/v8.9.4/lib/node_modules/wepy-cli/lib/compile.js:132:28
...
原本打算升级wepy到1.6.1版本,但是npm获取不到该版本号的依赖包,之后使用npm run dev编译文件就出现了如上错误;后来用wepy build --watch可以编译,然后再换回npm编译报错,重新直接用wepy编译也是同样报错;
不知道怎么提供复现问题的demo
@Gcaufy
刚刚我也遇到这个问题。我做了三件事:1.升级了nodejs、2.升级了wepy、3.重新build。用到的命令如下:
1.升级nodejs
1.1 用管理员账户打开powershell,执行:Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
1.2 npm install -g npm-windows-upgrade
npm-windows-upgrade
参考见这里
需要手动选择版本,选了最高版本号:5.7.1
2.升级wepy
npm install wepy-cli -g
3.重新build
wepy build
提示: [信息] 检测到wepy版本不符合要求,正在尝试更新,请稍等。 ... 提示:[完成] 已完成更新,重新启动编译。
解决错误
@BoleLee 我遇到的跟你是一样的错误,同样是提示TypeError: Cannot read property 'script' of null
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
因为这个 Issue 最近没有任何有效回复,所以被自动标记为了stale。 如果在未来7天依旧没有任何激活操作,那么该 Issue 将会被自动关闭。 感谢您的提问。