question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could not find a declaration file for module 'source-map'

See original GitHub issue

When 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:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
zwwtj2014commented, Feb 27, 2018

@symphony2014 Maybe package @types/source-map installed into node_modules has no type declaration file index.d.ts because of incorrect version. And you can try to set @types/source-map with version 0.5.2 instead of ^0.5.x.

0reactions
angular-automatic-lock-bot[bot]commented, Sep 9, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found