Reputation: 2415
I'm trying to install a NodeJS module called "karma-typescript-preprocessor" (See: https://npmjs.org/package/karma-typescript-preprocessor), but I'm getting an error when trying to install it. It is used by Karma to compile typescript files before testing. Here's the error I get. How do I fix this?
C:\Users\Me\WebstormProjects\Core>npm install karma-typescript-preprocessor
npm http GET https://registry.npmjs.org/karma-typescript-preprocessor
npm http 304 https://registry.npmjs.org/karma-typescript-preprocessor
npm ERR! Error: No compatible version found: karma-typescript-preprocessor@'>=0.1.0-0 <0.2.0-0'
npm ERR! Valid install targets:
npm ERR! ["0.0.2","0.0.4","0.0.5","0.0.6"]
npm ERR! at installTargetsError (C:\Program Files (x86)\nodejs\node_modules\npm\lib\cache.js:719:10)
npm ERR! at next (C:\Program Files (x86)\nodejs\node_modules\npm\lib\cache.js:698:17)
npm ERR! at C:\Program Files (x86)\nodejs\node_modules\npm\lib\cache.js:675:5
npm ERR! at saved (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\npm-registry-client\lib\get.js:142:7)
npm ERR! at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:133:7
npm ERR! at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <[email protected]>
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "instal
l" "karma-typescript-preprocessor"
npm ERR! cwd C:\Users\Me\WebstormProjects\Core
npm ERR! node -v v0.10.21
npm ERR! npm -v 1.3.11
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\Me\WebstormProjects\Core\npm-debug.log
npm ERR! not ok code 0
C:\Users\Me\WebstormProjects\Core>
I have added the dependency to package.json
"dependencies": {
"express": "3.4.7",
"ejs": "*",
"less-middleware": "*",
"formidable": "1.0.x",
"socket.io": "0.9.x",
"karma-typescript-preprocessor": "~0.1"
}
I am trying to install the module in my project directory. If I try to install outside the Project directory, the module gets installed, but karma does not see it. Here's the error it throws:
INFO [karma]: Karma v0.10.9 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
WARN [preprocess]: Can not load "typescript", it is not registered!
Perhaps you are missing some plugin?
INFO [Chrome 31.0.1650 (Windows 7)]: Connected on socket tyVcKoZygd-TRPnrm_WW
INFO [Chrome 31.0.1650 (Windows 7)]: Connected on socket o5hgQaj7f4B8-Ovfm_WX
INFO [Chrome 31.0.1650 (Windows 7)]: Connected on socket fvjPXprGmKQxWHROm_WY
Chrome 31.0.1650 (Windows 7) ERROR
Uncaught SyntaxError: Unexpected reserved word
at C:/Users/Anjan/WebstormProjects/Core/TsUnit/StartTest.ts:8
Chrome 31.0.1650 (Windows 7) ERROR
Uncaught SyntaxError: Unexpected reserved word
at C:/Users/Anjan/WebstormProjects/Core/TsUnit/StartTest.ts:8
Chrome 31.0.1650 (Windows 7) ERROR
Uncaught SyntaxError: Unexpected reserved word
at C:/Users/Anjan/WebstormProjects/Core/TsUnit/StartTest.ts:8
Chrome 31.0.1650 (Windows 7) ERROR
Uncaught SyntaxError: Unexpected token :
Chrome 31.0.1650 (Windows 7): Executed 0 of 0 ERROR (0.363 secs / 0 secs)
Chrome 31.0.1650 (Windows 7): Executed 0 of 0 ERROR (1.162 secs / 0 secs)
Chrome 31.0.1650 (Windows 7): Executed 0 of 0 ERROR (0.643 secs / 0 secs)
Upvotes: 1
Views: 1560
Reputation: 275917
"karma-typescript-preprocessor": "~0.1"
is invalid. Try "karma-typescript-preprocessor": "0.0.6"
run npm info karma-typescript-preprocessor
to find which versions are available.
Upvotes: 1