Comments (15)
Wait, is this being transpiled? If so, it probably is a Webpack config error of some sort, or at least a problem how the code is being transpiled. __dirname should resolve to "your-app/node_modules/figlet/lib/", and it's joined with "../fonts", which gives the directory to the fonts folder.
Another option may be to use the new "importable-fonts" that I added to the project. I haven't yet tested these, which is why it's not advertised. However, I'm adding them for use in front-end apps that get transpiled. The fonts are actually there, and I envision them being used like this:
import standard from 'figlet/importable-fonts/Standard.js'
figlet.parseFont('Standard', standard);
figlet.text('test', {
font: 'Standard',
}, function(err, data) {
console.log(data);
});
Though again, I haven't tested these yet due to some computer issues I'm having.
from figlet.js.
That path looks a little odd. I don't get that on my end, but I've updated the code so that kind of path should never arise. I've pushed a new version. If you update to v1.2.2, do you still get that error?
from figlet.js.
I have updated figlet but it's now trying to get the font from my E: drive?
{ [Error: ENOENT: no such file or directory, open 'E:\fonts\Standard.flf']
errno: -4058,
code: 'ENOENT',
syscall: 'open',
path: 'E:\\fonts\\Standard.flf' }
from figlet.js.
Couple questions:
- what directory are you running from?
- what OS are you using?
- what is the full path of the Figlet.js lib that’s running?
- is the lib installed for a local project or globally?
- where is node installed and what version of node are you using?
from figlet.js.
Directory: E:
OS: Windows 10
Path: E:\Discord\SupremeBotty\node_modules\figlet\lib
Installed: Local
Node: v10.15.3
from figlet.js.
I wonder if this is a Windows path issue. Can you modify the node_modules/figlet/lib/node-figlet.js file and then on line 9 add:
console.log(__dirname);
console.log(fontDir);
console.log( path.join(__dirname, “../fonts/“);
console.log( path.join(__dirname, ‘..’, ‘fonts’); // I’m on mobile, you may have to fix the quotes
My guess is the last one should print out the correct path, if so, I’ll do another update.
from figlet.js.
Looked into the issue for him, he was using it along side webpack.
Fixed it by the following to the webpack config
node: { __dirname: false }
from figlet.js.
I wouldn't exactly say that's a fix...
{ [Error: ENOENT: no such file or directory, open 'E:\Discord\SupremeBotty\fonts\Standard.flf']
errno: -4058,
code: 'ENOENT',
syscall: 'open',
path: 'E:\\Discord\\SupremeBotty\\fonts\\Standard.flf' }
from figlet.js.
Thanks for the alternative but for some reason, the new figlet update seems to be infinitely indexing my WebStorm on the huge amount of fonts it has, It seems to be happening on to a friend also.
from figlet.js.
The fonts folder has 287 files, the new importable-fonts folder also has 287 files. That doesn't seem like it should cause such a problem.
from figlet.js.
I'm not sure why it is, but it is.
from figlet.js.
I'm not familiar with WebStorm, but you may try marking the directory like shown here: https://stackoverflow.com/questions/36676075/webstorm-11-infinite-indexing-with-angular2
from figlet.js.
That alternative you suggested has not worked very well. It makes the text move slightly off Image, It works fine when I manually put the .flf into a new fonts folder in my projects directory (because of the path error mentioned previously) but the parsefont thing really messes up the font for me.
from figlet.js.
Hi,
same problem here with intellij 2019.1 : infinite indexing with figlet/lib directory :'(
from figlet.js.
@cyberbobjr I have a hacky fix for it, Just delete all the fonts and importable-fonts you don't use and it should fix the indexing. https://github.com/REAZN/figlet.js
from figlet.js.
Related Issues (20)
- Add "ANSI Regular" font to the font directory HOT 3
- Examples directory of the repository is part of the NPM package HOT 3
- can't find font file HOT 3
- Slant front weird rendering HOT 13
- How to use different colors HOT 3
- [ PLS HELP ] want to change the header text , but in bash.bashrc file there is no written text HOT 1
- Possibility to add one empty line at the top/beginning HOT 2
- Can this library be used in ES without webpack? HOT 4
- Cannot read property 'reduce' of undefined HOT 2
- Can blank lines be preserved?
- Problem with code that pollute array prototype
- small slant.flf does not work in Ubuntu HOT 1
- TypeError: Cannot read properties of undefined (reading 'reduce') HOT 6
- Typo in README.md
- Readability issues in README.md
- TTF -> FLF? HOT 2
- Cannot find module figlet HOT 1
- [README] Build Status Shield Button Not Working HOT 1
- Question: Why doesn't figlet return the new text and why is error the first parameter of the callback? HOT 1
- [Suggestion] Way to import every font using Webpack
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from figlet.js.