Could not find a declaration file for module 'source-map'
See original GitHub issueWhen I try to build angular-cli, I got this error, anyone can help me?
Versions
node --version
V8.9.3
Windows10
Repro steps
- Step 1
npm run build
- Step 2
- Step 3
Observed behavior
Compilation error.
packages/@ngtools/webpack/src/plugin.ts(5,28): error TS7016: Could not find a declaration file for module 'source-map'. 'E:/angular-cli/node_modules/source-map/source-map.js' implicitly has an 'any' type.
Try `npm install @types/source-map` if it exists or add a new declaration (.d.ts) file containing `declare module 'source-map';`
packages/@ngtools/webpack/src/refactor.ts(5,53): error TS7016: Could not find a declaration file for module 'source-map'. 'E:/angular-cli/node_modules/source-map/source-map.js' implicitly has an 'any' type.
Try `npm install @types/source-map` if it exists or add a new declaration (.d.ts) file containing `declare module 'source-map';`
Desired behavior
Mention any other details that might be useful (optional)
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Could not find a declaration file for module 'module-name ...
In order for this to work, I had to make declare module '...' the first line of code in the module.d.ts file, and...
Read more >Could not find declaration file for module 'X' Error | bobbyhadz
The error "Could not find a declaration file for module" occurs when TypeScript cannot find the type declaration for a module. To solve...
Read more >How to fix error TS7016: Could not find a declaration file for ...
Try `npm install @types/XYZ` if it exists or add a new declaration (.d. · declare module 'XYZ';. Lastly, you also need to add...
Read more >Writing a typescript declaration file for an external js nodejs ...
I have been following information at Typescript declaration files ... TS7016: Could not find a declaration file for module 'jinxed'.
Read more >TSConfig Reference - Docs on every TSConfig option
An error occurs if any of the files can't be found. ... Without this flag, using an export from a UMD module requires...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@symphony2014 Maybe package
@types/source-map
installed into node_modules has no type declaration fileindex.d.ts
because of incorrect version. And you can try to set@types/source-map
with version0.5.2
instead of^0.5.x
.This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.