I try to load P5
type from my node_modules, but when I compile my code the terminal returns this compilation error message
Module not found: Error: Can't resolve 'p5' in '/Users/stan/En_cours/code/github/P5JS_TypeScript_WebPack/Template_V2/src'
@ ./src/sketch.ts 2:0-25 23:18-20
to import in my code I use import * as p5 from "p5";
but when i read the log, the compiler tries to search directly in the src
folder, I don't find a solution to ask to go in the good folder in node_modules/@types/p5
.
For information I'm a beginner in TypeScript, NPM, Webpack...
I also tried
import p5 from "../node_modules/@types/p5";
import * as p5 from "./node_modules/@types/p5";
I found those links, but I don't find a solution which works.
https://www.typescriptlang.org/docs/handbook/module-resolution.html
https://github.com/Microsoft/TypeScript/issues/16472
in my package.json
I have
"devDependencies": {
"@types/p5": "^0.9.0
.../...
},