简体   繁体   English

流星npm安装font-awesome,找不到模块'fontawesome'“

[英]Meteor npm install font-awesome, cannot find module 'fontawesome'"

I am using meteor 1.4.1.1 with NPM support. 我正在使用具有NPM支持的流星1.4.1.1。 I installed the npm "font-awesome" package and getting the error on the console "Uncaught Error: Cannot find module 'fontawesome'". 我安装了npm“ font-awesome”软件包,并在控制台上看到错误“未捕获的错误:找不到模块'fontawesome'”。 I installed it with 我安装了

meteor npm install --save font-awesome

The package seems to be installed correctly, folder inside of node_modules is created. 该软件包似乎已正确安装,在node_modules内部的文件夹已创建。

I imported the package in client/main.js with import fontawesome from 'font-awesome'; import fontawesome from 'font-awesome';import fontawesome from 'font-awesome';到client / main.js中import fontawesome from 'font-awesome';

Sadly no icons are showing up, when i console.log(fontawesome); 不幸的是,当我console.log(fontawesome);时,没有任何图标显示console.log(fontawesome); i get the above mentioned error back. 我得到上述错误回来。

Thanks in advance, mario 预先感谢,马里奥

There are different Font Awesome packages with almost the same name: 有几乎相同名称的不同Font Awesome软件包:

The first seems to be pretty useless for use in Node, or as a module, since it doesn't provide a main entry in its package.json . 第一个对于在Node中或作为模块使用似乎是毫无用处的,因为它没有在package.json提供main条目。

Judging by your expectations ( "no icons are showing up" ), I think you want to install the second package (without the hyphen in the name), which shows the following for me: 根据您的期望( “未显示任何图标” ),我认为您想安装第二个软件包(名称中不带连字符),这对我来说显示以下内容:

$ node -pe 'require("fontawesome")'
{ [Function]
  glass: '�',
  music: '�',
  search: '�',
  envelopeO: '�',
  ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM