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.

package.json from npm appears to point to the wrong source directory

See original GitHub issue

I was trying to get the demo to compile with TS 4.3, but I kept getting stuck with this error trying to import * as tsickle from "tsickle";

Cannot find module ‘tsickle’ or its corresponding type declarations.

Seems like typings and main are set incorrect, or at least they don’t match what actually gets installed by npm. Making the following changes seems to make everything happy.

{
  ... 
-  "main": "src/tsickle.js",
+  "main": "build/src/tsickle.js",
  ...
-  "typings": "src/tsickle.d.ts",
+  "typings": "build/src/tsickle.d.ts",
  "version": "0.40.0"
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
mprobstcommented, Jun 15, 2021

There is a published 0.41.0 now though which you should be able to depend on.

0reactions
mprobstcommented, Jun 15, 2021

@BrianLeishman not quite, see PR #1273. I also had to bump the version required, and while I was at it, included the demo build in our CI, so this hopefully won’t break again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why npm tries to find package.json in the wrong directory?
Try this : Delete node_modules folder. Then run : $ npm cache clean $ npm install.
Read more >
[BUG] npm using the wrong package.json file from a parent ...
json file I use for this project. I wasn't able to create a minimal reproductible folder structure.
Read more >
package.json - npm Docs
The name ends up being part of a URL, an argument on the command line, and a folder name. Therefore, the name can't...
Read more >
Main property in package.json defines package entry point
First, Node looks for a package.json file and checks if it contains a main property. It will be used to point a file...
Read more >
Why isn't the npm link command working? | Benjamin W Fox
^ you see the symlink to my-package created in the global node_modules folder, and it's pointing to the my-package directory. The same goes...
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