As I understand from tutorial pnpm creates symlinked .registry.npmjs.org
and other entries point under node_modules
. My project is on typescript
and I have @types
for typings in node_modules
. But this @types
has also in node_modules/.registry.npmjs.org/@types
. So I'm getting an error like:
/node_modules/.registry.npmjs.org/@types/jquery/3.3.5/node_modules/@types/jquery/index.d.ts(32,14): error TS2300: Duplicate identifier 'jQuery'.
...and
/node_modules/@types/jquery/index.d.ts(28,14): error TS2300: Duplicate identifier 'jQuery'.
tsconfig.json
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"lib": [
"es5",
"dom",
"es2015.promise"
],
"experimentalDecorators": true,
"sourceMap": true,
"allowSyntheticDefaultImports": true
},
"include": [
"src/**/*"
],
"exclude": [
"node_modules",
"scripts",
"src/contracts"
]
}
Any ideas how to resolve it?
"exclude": ["node_modules/.registry.npmjs.org"]
in yourtsconfig.json
file? That's the first thing I would try, but I'm not posting it as an answer because I'm not very confident it will work. – Reorganize"typeRoots": [ "./node_modules/@types"]
with it – Midinettetsc --traceResolution
might help. If you can't spot the problem from the output, post it in the question and I will look. – Reorganize"typescript": "^2.8.3",
– Midinetteinclude
option in tsconfig.json. In my case I'm using @types instead of it which install via npm and is placed in node_modules/@types – Midinette@types
as well, see package.json. – Quartana<reference path="./../../../node_modules/@types/jquery/index.d.ts" />
. I've removed this row and the issue dissapears – Midinette