tpadjen / ng2-prism Goto Github PK
View Code? Open in Web Editor NEWAn Angular2 codeblock highlighting component using Prismjs.
Home Page: http://braceyourself.io/ng2-prism
An Angular2 codeblock highlighting component using Prismjs.
Home Page: http://braceyourself.io/ng2-prism
Npm installacion not working
[David.Garcia.BCN-CLI-P117] ➤ npm i ng2-prism --save
npm WARN addRemoteGit Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit at ChildProcess.exithandler (child_process.js:203:12)
npm WARN addRemoteGit at emitTwo (events.js:87:13)
npm WARN addRemoteGit at ChildProcess.emit (events.js:172:7)
npm WARN addRemoteGit at maybeClose (internal/child_process.js:818:16)
npm WARN addRemoteGit at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
npm WARN addRemoteGit prismjs/prism%40gh-pages resetting remote C:\Users\David.Garcia\AppData\Roaming\npm-cache\_git-remotes\git-github-com-prismjs-prism-40gh-pages-git-75add8fd because of error: { [Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit ]
npm WARN addRemoteGit killed: false,
npm WARN addRemoteGit code: 1,
npm WARN addRemoteGit signal: null,
npm WARN addRemoteGit cmd: 'git -c core.longpaths=true config --get remote.origin.url' }
npm ERR! git clone --template=C:\Users\David.Garcia\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git://github.com/prismjs/prism%40gh-pages.git C:\Users\David.Garcia\AppData\Roaming\npm-cache\_git-remotes\git-github-com-prismjs-prism-40gh-pages-git-75add8fd: Cloning into bare repository 'C:\Users\David.Garcia\AppData\Roaming\npm-cache\_git-remotes\git-github-com-prismjs-prism-40gh-pages-git-75add8fd'...
npm ERR! git clone --template=C:\Users\David.Garcia\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git://github.com/prismjs/prism%40gh-pages.git C:\Users\David.Garcia\AppData\Roaming\npm-cache\_git-remotes\git-github-com-prismjs-prism-40gh-pages-git-75add8fd: fatal: read error: Invalid argument
npm WARN addRemoteGit Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit at ChildProcess.exithandler (child_process.js:203:12)
npm WARN addRemoteGit at emitTwo (events.js:87:13)
npm WARN addRemoteGit at ChildProcess.emit (events.js:172:7)
npm WARN addRemoteGit at maybeClose (internal/child_process.js:818:16)
npm WARN addRemoteGit at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
npm WARN addRemoteGit prismjs/prism%40gh-pages resetting remote C:\Users\David.Garcia\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-prismjs-prism-40gh-pages-git-79ba2285 because of error: { [Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit ]
npm WARN addRemoteGit killed: false,
npm WARN addRemoteGit code: 1,
npm WARN addRemoteGit signal: null,
npm WARN addRemoteGit cmd: 'git -c core.longpaths=true config --get remote.origin.url' }
npm ERR! git clone --template=C:\Users\David.Garcia\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror https://github.com/prismjs/prism%40gh-pages.git C:\Users\David.Garcia\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-prismjs-prism-40gh-pages-git-79ba2285: Cloning into bare repository 'C:\Users\David.Garcia\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-prismjs-prism-40gh-pages-git-79ba2285'...
npm ERR! git clone --template=C:\Users\David.Garcia\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror https://github.com/prismjs/prism%40gh-pages.git C:\Users\David.Garcia\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-prismjs-prism-40gh-pages-git-79ba2285: fatal: unable to access 'https://github.com/prismjs/prism%40gh-pages.git/': The requested URL returned error: 400
npm WARN addRemoteGit Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit at ChildProcess.exithandler (child_process.js:203:12)
npm WARN addRemoteGit at emitTwo (events.js:87:13)
npm WARN addRemoteGit at ChildProcess.emit (events.js:172:7)
npm WARN addRemoteGit at maybeClose (internal/child_process.js:818:16)
npm WARN addRemoteGit at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
npm WARN addRemoteGit prismjs/prism%40gh-pages resetting remote C:\Users\David.Garcia\AppData\Roaming\npm-cache\_git-remotes\git-github-com-prismjs-prism-40gh-pages-git-0c7d7701 because of error: { [Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit ]
npm WARN addRemoteGit killed: false,
npm WARN addRemoteGit code: 1,
npm WARN addRemoteGit signal: null,
npm WARN addRemoteGit cmd: 'git -c core.longpaths=true config --get remote.origin.url' }
npm ERR! git clone --template=C:\Users\David.Garcia\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror [email protected]:prismjs/prism%40gh-pages.git C:\Users\David.Garcia\AppData\Roaming\npm-cache\_git-remotes\git-github-com-prismjs-prism-40gh-pages-git-0c7d7701: Cloning into bare repository 'C:\Users\David.Garcia\AppData\Roaming\npm-cache\_git-remotes\git-github-com-prismjs-prism-40gh-pages-git-0c7d7701'...
npm ERR! git clone --template=C:\Users\David.Garcia\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror [email protected]:prismjs/prism%40gh-pages.git C:\Users\David.Garcia\AppData\Roaming\npm-cache\_git-remotes\git-github-com-prismjs-prism-40gh-pages-git-0c7d7701: ssh_exchange_identification: read: Connection reset by peer
npm ERR! git clone --template=C:\Users\David.Garcia\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror [email protected]:prismjs/prism%40gh-pages.git C:\Users\David.Garcia\AppData\Roaming\npm-cache\_git-remotes\git-github-com-prismjs-prism-40gh-pages-git-0c7d7701: fatal: Could not read from remote repository.
npm ERR! git clone --template=C:\Users\David.Garcia\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror [email protected]:prismjs/prism%40gh-pages.git C:\Users\David.Garcia\AppData\Roaming\npm-cache\_git-remotes\git-github-com-prismjs-prism-40gh-pages-git-0c7d7701:
npm ERR! git clone --template=C:\Users\David.Garcia\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror [email protected]:prismjs/prism%40gh-pages.git C:\Users\David.Garcia\AppData\Roaming\npm-cache\_git-remotes\git-github-com-prismjs-prism-40gh-pages-git-0c7d7701: Please make sure you have the correct access rights
npm ERR! git clone --template=C:\Users\David.Garcia\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror [email protected]:prismjs/prism%40gh-pages.git C:\Users\David.Garcia\AppData\Roaming\npm-cache\_git-remotes\git-github-com-prismjs-prism-40gh-pages-git-0c7d7701: and the repository exists.
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\David.Garcia\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "i" "ng2-prism" "--save"
npm ERR! node v5.0.0
npm ERR! npm v3.8.8
npm ERR! code 128
npm ERR! Command failed: git -c core.longpaths=true clone --template=C:\Users\David.Garcia\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror [email protected]:prismjs/prism%40gh-pages.git C:\Users\David.Garcia\AppData\Roaming\npm-cache\_git-remotes\git-github-com-prismjs-prism-40gh-pages-git-0c7d7701
npm ERR! Cloning into bare repository 'C:\Users\David.Garcia\AppData\Roaming\npm-cache\_git-remotes\git-github-com-prismjs-prism-40gh-pages-git-0c7d7701'...
npm ERR! ssh_exchange_identification: read: Connection reset by peer
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR!
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! C:\agbarbundle\workspaces\workspace-xf\demo-xf\demo-xf-angular2\npm-debug.log
In AOT, run into below error -
Unexpected value 'CodeblockComponent in .../node_modules/ng2-prism/src/codeblock.component.d.ts' declared by the module 'TestModule in .../src/main/webapp/src/test/test.module.ts'. Please add a @Pipe/@Directive/@component annotation.
Failed to compile
In some places (as far as I can tell in src/codeblock.component.scss
and src/codeblock.component.ts
), files in the directory ../node_modules/
are referenced.
The reference in the .scss
file is resolved during the build process of ng2-prism and thus does not appear in the npm package, but the reference in the .ts
file remains in the resulting .d.ts
file.
When depending on ng2-prism in a project, the file structure will look like this (using NPM v3):
node_modules
|-- ng2-prism
| |-- bundle
| | |-- codeblock.component.d.ts
|-- angular2
| |-- typings
| | |-- browser.d.ts
The reference to ../node_modules/angular2/typings/browser.d.ts
in codeblock.component.d.ts
can thus not be resolved, as the node_modules
folder is higher in the hierarchy. This results in a tsc compilation error.
I don't know what's the best way to resolve this issue, but I would assume the triple slash reference to angular2/typings/browser.d.ts
is not needed and can be removed?
Currently, the dependency to prismjs
is in the devDependencies
. As it is required for using ng2-prism, it should be in the dependencies
. Otherwise, applications using ng2-prism need to depend on it by hand.
In addition, the require
statements in src/code-renderer.component.ts
should use prismjs/
instead of prism/
, in order to match the npm dependency. Otherwise, users of ng2-prism have to not only add prismjs as a dependency, but also have to rename/symlink it to prism.
Installation is not working, will you update PEER DEPENDENCY
?
Angular2 recently updated their dependencies in NPM by scoping them. As such, ng2-prism's dependencies don't work anymore.
Dependencies should be like this now:
"dependencies": {
"@angular/core": "2.0.0-rc.1",
...
}
And
import { Component, ...} from '@angular2/core';
You can see a list of all angular2 packages on NPM here.
Do you consider updating library to newest angular2 version?
C:/Users/George/Desktop/GitHub/Admin-panel/node_modules/ng2-prism/src/codeblock.component.d.ts (1,67): Cannot find module 'angular2/core'.
Hi! I would like to use your component, but the problem is that I want it to highlight based on a custom internal file format.
Is there any way to add customized highlighting rules?
ng2-prism still uses old classes from Angular2 since rc1, causing angular/angular2-seed#79.
Trying to install with angular 2.0.0-beta.7
i get Peer [email protected] wants [email protected]
however when using 2.0.0-beta.6
i get Peer [email protected] wants [email protected]
and Peer [email protected] wants reflect-metadata@^0.1.3
app.module.ts do not import Codeblock. What steps i need follow when install it. Please Help
1 npm i ng2-prism --save
2 import from app.module.ts Do not see codeblock library.
3 write in component.html
title
Despite locally configuring the GIT proxy setting to pull resources through the corporate firewall I'm behind, I'm unable to npm install
ng2-prism, because it doesn't use the HTTP url. It is the only module (of hundreds) I'm not able to install because of this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.