I'm trying to use ts-node with nodemon. Both are installed using yarn and my package.json has the following structure:
{
"name": "yarnTest",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"devDependencies": {
"@types/express": "^4.0.36",
"bootstrap-sass": "^3.3.7",
"nodemon": "^1.11.0",
"typescript": "^2.4.1"
},
"dependencies": {
"@types/chalk": "^0.4.31",
"chalk": "^2.0.1",
"express": "^4.15.3",
"ts-node": "^3.2.0"
},
"scripts": {
"dev": "nodemon --exec 'ts-node --cache-directory .tscache' ./src/www.ts",
"start": "ts-node --fast ./dist/www.ts"
}
}
Now, when I use "yarn run dev", it executes nodemon and nodemon tries to execute "ts-node" but nodemon tells me that the command "ts-node" does not exist:
Der Befehl "'ts-node" ist entweder falsch geschrieben oder konnte nicht gefunden werden.
Yarn is installed globally but ts-node is installed for my project only. I already tried:
"scripts": {
"dev": "nodemon --exec 'yarn run ts-node --cache-directory .tscache' ./src/www.ts",
"start": "ts-node --fast ./dist/www.ts"
}
But this gives me the error that "yarn" is not found :( Any ideas how to fix this issue?
"nodemon --exec 'yarn run ts-node --cache-directory .tscache' ./src/www.ts"
? – Priscian