Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in "chalk": "^4.0.0" #405

Closed
jasonmacer opened this issue May 31, 2020 · 3 comments
Closed

Error in "chalk": "^4.0.0" #405

jasonmacer opened this issue May 31, 2020 · 3 comments

Comments

@jasonmacer
Copy link

jasonmacer commented May 31, 2020

I am getting the following error when trying to use the latest 4.0.0 version. I have even rolled back and am getting the same issue.

Here is the error:

node_modules\chalk\source\templates.js:115
throw new Error('Found extraneous } in Chalk template literal');
^
Error: Found extraneous } in Chalk template literal
at O:\XXXXXX\node_modules\chalk\source\templates.js:115:11
at String.replace ()
at module.exports (O:\XXXXXX\node_modules\chalk\source\templates.js:105:12)
at chalkTag (O:\XXXXXX\node_modules\chalk\source\index.js:212:9)
at chalk.template (O:\XXXXXX\node_modules\chalk\source\index.js:40:38)
at msg (O:\XXXXXX\server.js:14:25)
at O:\XXXXXX\node_modules\console-stamp\lib\utils.js:49:27
at String.replace ()
at O:\XXXXXX\node_modules\console-stamp\lib\utils.js:48:29
at Array.forEach ()

Here is my actual code:

const chalk = require('chalk');
const lMap = {
//log: chalk.hex('#183e69'),
log: '',
error: 'red',
info: 'blue',
warn: 'yellow',
debug: 'cyan'
}
require('console-stamp')(console, {
format: '(#).yellow :date(yy-mm-dd HH:MM:ss.l).green (#).yellow :msg',
tokens: {
msg: ( { method, msg } ) => {
return chalk{${lMap[method] || 'reset'} ${msg}};
}
}
});

global.Log = console.log.bind(console);
global.ILog = console.info.bind(console);
global.WLog = console.warn.bind(console);
global.ELog = console.error.bind(console);
global.DLog = console.debug.bind(console);

Has anyone else run into this issue.

Also, here is my dependencies:

"axios": "^0.19.1",
"body-parser": "^1.18.3",
"chalk": "^4.0.0",
"cluster": "^0.7.7",
"console-stamp": "~3.0.0-rc4.1",
"cookie-session": "^2.0.0-beta.3",
"cors": "^2.8.5",
"crypto": "^1.0.1",
"dotenv": "^6.2.0",
"express": "^4.17.1",
"express-fileupload": "^1.1.4",
"express-validator": "^5.3.1",
"findit": "^2.0.0",
"fs": "0.0.1-security",
"generate-password": "^1.5.1",
"hl7": "^1.1.1",
"js-base64": "^2.5.2",
"jsonwebtoken": "^8.5.1",
"jwks-rsa": "^1.4.0",
"make-dir": "^3.0.0",
"moment": "^2.24.0",
"mysql2": "^2.1.0",
"nodemailer": "^4.7.0",
"nodemon": "^1.19.1",
"npm": "^6.9.0",
"path": "^0.12.7",
"sequelize": "^5.18.4",
"sequelize-cli": "^5.5.1",
"simple-hl7": "^3.2.1",
"ssh2-sftp-client": "^5.1.2",
"throng": "^4.0.0",
"uuid": "^3.3.2"

@papb
Copy link

papb commented May 31, 2020

Hello, please learn to format your issue with Markdown. You can edit your post by clicking 'edit' in the three dots.

@jasonmacer
Copy link
Author

I did not realize that was a requirement on this project as there are no notifications as such that I saw before posting.

Hello, please learn to format your issue with Markdown. You can edit your post by clicking 'edit' in the three dots.

@jasonmacer
Copy link
Author

Never mind. This isn't an issue. I figured out what was causing it. Not only did i not need to include "chalk" again but i also needed to escape the ' in the ('#DEADED')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants