Prism: Failed to load prism syntax: shell

Created on 22 Aug 2018  Â·  6Comments  Â·  Source: PrismJS/prism

Failed to load prism syntax: shell
{ Error: Cannot find module 'prismjs/components/prism-shell.js'
at Function.Module._resolveFilename (module.js:527:15)
at Function.Module._load (module.js:476:23)
at Module.require (module.js:568:17)
at require (internal/module.js:11:18)
at requireSyntax (/Users/meitu/hexo/golang-notes/node_modules/gitbook-plugin-prism/index.js:31:3)
at Object.code (/Users/meitu/hexo/golang-notes/node_modules/gitbook-plugin-prism/index.js:103:11)
at Record.TemplateBlock.applyBlock (/Users/meitu/.gitbook/versions/3.2.3/lib/models/templateBlock.js:205:23)
at /Users/meitu/.gitbook/versions/3.2.3/lib/output/getModifiers.js:56:33
at /Users/meitu/.gitbook/versions/3.2.3/lib/output/modifiers/highlightCode.js:47:24
at /Users/meitu/.gitbook/versions/3.2.3/lib/output/modifiers/editHTMLElement.js:11:16 code: 'MODULE_NOT_FOUND' }

support

Most helpful comment

@huweihuang gitbook-plugin-prism plugin default not support shell as an alias for bash. but you can customize alias, like this:

// book.json
"pluginsConfig": {
    "prism": {
      "lang": {
        "shell": "bash"
      }
    }
}

All 6 comments

Can you provide more details? Code snippets, source code, etc?

The error will appear in the following ways:
```shell
shell scripts
```
failed to load prism syntax: shell,

this problem can be solved like :
```bash
shell scripts
```

You have an old version of Prism; the latest version includes shell as an alias for bash.

This may be an issue with Gitbook itself, if the version of Prism is bundled with that library.

I just run the command gitbook install
the output is :

info: installing plugin "prism"
info: install plugin "prism" (*) from NPM with version 2.4.0
info: >> plugin "prism" installed with success

so the prism version is 2.4.0,but the latest version is v1.15.0?

@huweihuang gitbook-plugin-prism plugin default not support shell as an alias for bash. but you can customize alias, like this:

// book.json
"pluginsConfig": {
    "prism": {
      "lang": {
        "shell": "bash"
      }
    }
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

RobLoach picture RobLoach  Â·  9Comments

RunDevelopment picture RunDevelopment  Â·  5Comments

TheZoker picture TheZoker  Â·  9Comments

jiantosca picture jiantosca  Â·  4Comments

finnianr picture finnianr  Â·  4Comments