Cannot run javascript umd command line tool: [TypeError: _.any is not a function]

时间秒杀一切 提交于 2019-12-24 12:05:06

问题


I'm just trying out urequire but cant get a simple example to work. In windows on my desktop i have a "SomeFolder" folder with a single file in it called test.js. It looks like this...

define([], function() {
  return {the:'PersonViewModule'}
});

I run the following command...

c:\Users\blah\Desktop> urequire UMD SomeFolder/ -o build

[uRequire/process/Bundle] ERRor: Unknown error while 
loading/refreshing/processing 'test.js'.
error.nested = [TypeError: _.any is not a function]
[uRequire/urequireCMD] ERRor: uRequireCmd done() #1 with errors in 0.023secs.

Not sure what I'm doing wrong. Seems like an issue with underscore or lodash but I tried a few local npm installs with and without -g flag on both of those libs with no luck.

Submitted a github issue here


回答1:


So when i install urequire with the following command it works...

npm install urequire@0.7.0-beta.25

URequire does not work (showing the errors described above) when installed like this...

npm install urequire


来源:https://stackoverflow.com/questions/35135935/cannot-run-javascript-umd-command-line-tool-typeerror-any-is-not-a-function

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!