ReferenceError: process is not defined when using with TS in Angular
BernhardFuchs opened this issue · 3 comments
BernhardFuchs commented
When creating a function like the following:
import * as _parseJson from 'parse-json';
export function parseJson(json: string): string {
return _parseJson(json);
}
And calliing it from an Angular service like this:
parseJson(someJson)
results in above error.
The error points to following line:
const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm');
Versions:
- Angular: 8.1.1
- parse-json: 5.0.0
sindresorhus commented
That is a problem with the Angular build tool. This package works fine in Node.js.
sbimochan commented
facing same issue with node vue.js
sbimochan commented
but not in v4.0.0