package.json from npm appears to point to the wrong source directory
See original GitHub issueI 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:
- Created 2 years ago
- Comments:7
Top 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 >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 FreeTop 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
Top GitHub Comments
There is a published 0.41.0 now though which you should be able to depend on.
@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.