mean.io assetmanager.init(...返回JS错误 [英] mean.io assetmanager.init(... returns JS error

查看:68
本文介绍了mean.io assetmanager.init(...返回JS错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用MEAN.io堆栈.我做了所需的初始化.创建文件夹,进行npm安装,获取库.

I want to use MEAN.io stack. I did the required initialization. Created the folder, did the npm install, got the libraries.

现在在我拥有的server/config/express.js中

now in server/config/express.js I have

assetmanager = require('assetmanager'),

// Import your asset file
var assets = require('./assets.json');
assetmanager.init({ // this is line 75
    js: assets.js,
    css: assets.css,
    debug: (process.env.NODE_ENV !== 'production'),
    webroot: 'public/public'
});

这给了我这个错误:

server/config/express.js:75
assetmanager.init({
             ^
TypeError: Object #<Object> has no method 'init'
    at module.exports (server/config/express.js:75:18)
    at module.exports (server/config/system/bootstrap.js:49:48)
    at Object.<anonymous> (server.js:20:54)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:902:3
[nodemon] app crashed - waiting for file changes before starting...

我已经安装了软件包.

npm info assetmanager version
0.1.3

推荐答案

作者错误地发布了一篇文章资产管理器的版本不兼容.您可以通过运行npm install assetmanager@0.1.2命令来使用v0.1.2版.

The author mistakenly published an incompatible version of assetmanager. You can either use version v0.1.2 instead by running npm install assetmanager@0.1.2 command.

或更改您的代码以使其与最新版本兼容. 查看示例的自述文件.

Or change your code to be compatible with the latest. Check the README for the example.

这篇关于mean.io assetmanager.init(...返回JS错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆