我想使用 MEAN.io 堆栈。我做了所需的初始化。创建文件夹,安装 npm,获取库。
现在在 server/config/express.js 我有
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
最佳答案
作者mistakenly published an incompatible version of assetmanager .您可以通过运行 npm install assetmanager@0.1.2
命令来使用版本 v0.1.2。
或者更改您的代码以与最新版本兼容。 Check the README for the example .
关于javascript - mean.io assetmanager.init(... 返回 JS 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23949772/